test: fix flaky test-net-can-reset-timeout#14257
Conversation
|
I would like to expedite this so that it doesn't trip us up during Code + Learn later. /cc @nodejs/testing @bengl @joyeecheung @addaleax @refack |
|
With this change: $ tools/test.py -j 92 --repeat 920 test/parallel/test-net-can-reset-timeout.js
[02:14|% 100|+ 920|- 0]: Done
$ To compare with before the change, see #14241 (comment). |
There was a problem hiding this comment.
Just using .once instead seems a bit simpler?
|
@Trott I took the liberty of adding a comment with context, feel free to remove it, or whatever. |
f9936ed to
8ea652d
Compare
|
Switched to |
You didn't like my comment or just didn't see it? // When you write to a socket, it causes 'Timer.active' to be called on it.
// If `active` notices that it was previously removed (perhaps it timed out or
// something) it just does an 'inline append' which re-links the timer.
// Ref: https://github.com/nodejs/node-v0.x-archive/issues/481 |
I wasn't quite sure I understood it out of context. I thought reading the test was actually more clear than the comment, but that may say more about me than the comment? Thinking about it more, though, I think having a link to the issue is a good idea so I'll at least add that back in... |
8ea652d to
f9d1804
Compare
Use `.once()` rather than `.on()` for timeout listener. Add comment with URL for issue explaining the purpose of the test. (h/t refack) PR-URL: nodejs#14257 Fixes: nodejs#14241 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
|
Landed in 5d3609d |
Use `.once()` rather than `.on()` for timeout listener. Add comment with URL for issue explaining the purpose of the test. (h/t refack) PR-URL: #14257 Fixes: #14241 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Use `.once()` rather than `.on()` for timeout listener. Add comment with URL for issue explaining the purpose of the test. (h/t refack) PR-URL: #14257 Fixes: #14241 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Use `.once()` rather than `.on()` for timeout listener. Add comment with URL for issue explaining the purpose of the test. (h/t refack) PR-URL: #14257 Fixes: #14241 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Use `.once()` rather than `.on()` for timeout listener. Add comment with URL for issue explaining the purpose of the test. (h/t refack) PR-URL: #14257 Fixes: #14241 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Use `.once()` rather than `.on()` for timeout listener. Add comment with URL for issue explaining the purpose of the test. (h/t refack) PR-URL: #14257 Fixes: #14241 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
timeoutcan fire more than once, so remove the listener after the first time. The test still checks for issue that the test was originally written for (nodejs/node-v0.x-archive#481).Fixes: #14241
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
test net