-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: fix flaky test-dgram-empty-packet & friends #9724
Conversation
f60c297
to
06c26b6
Compare
Looks like the CI had a hiccup on OS X, which is pretty relevant to this test. |
@cjihrig Yeah, looks like the bug on OS X is still there on the verison of OS X in CI. Putting the skip-code back in... |
CI looks good. /cc @nodejs/testing @indutny |
The changes look good. I only see an issue with relying that every UDP message is going to be received by the server. This, though highly unlikely, could be a source of flakiness. |
b33bfca
to
c1c40fd
Compare
@santigimeno I've wrapped the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a couple of suggestions. Thanks!
const port = this.address().port; | ||
|
||
client.on('message', common.mustCall(function onMessage(buffer, bytes) { | ||
clearTimeout(timer); | ||
clearInterval(interval); | ||
client.close(); | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe check that buffer is empty. Also s/bytes/info or even removing the 2nd argument if we're doing nothing with it
if (firstArg instanceof Buffer) { | ||
clearInterval(interval); | ||
client.close(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check firstArg
is empty too?
* Liberal use of common.mustCall() * Rename test-dgram-empty-packet -> test-dgram-send-empty-packet * Remove use of timers to avoid CI failures like seen in the Ref below: ``` not ok 237 parallel/test-dgram-empty-packet --- duration_ms: 0.717 severity: fail stack: |- ... throw new Error('Timeout'); ^ Error: Timeout at Timeout._onTimeout ... at ontimeout (timers.js:365:14) at tryOnTimeout (timers.js:237:5) at Timer.listOnTimeout (timers.js:207:5) ``` Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console:
Excellent suggestions from @santigimeno incorporated. CI again: https://ci.nodejs.org/job/node-test-pull-request/4978/ |
Raspberry Pi failure in CI is a build failure and unrelated. |
* Liberal use of common.mustCall() * Rename test-dgram-empty-packet -> test-dgram-send-empty-packet * Remove use of timers to avoid CI failures like seen in the Ref below: ``` not ok 237 parallel/test-dgram-empty-packet --- duration_ms: 0.717 severity: fail stack: |- ... throw new Error('Timeout'); ^ Error: Timeout at Timeout._onTimeout ... at ontimeout (timers.js:365:14) at tryOnTimeout (timers.js:237:5) at Timer.listOnTimeout (timers.js:207:5) ``` Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console: PR-URL: nodejs#9724 Reviewed-By: Santiago Gimeno <[email protected]>
Landed in 9b0f53d |
* Liberal use of common.mustCall() * Rename test-dgram-empty-packet -> test-dgram-send-empty-packet * Remove use of timers to avoid CI failures like seen in the Ref below: ``` not ok 237 parallel/test-dgram-empty-packet --- duration_ms: 0.717 severity: fail stack: |- ... throw new Error('Timeout'); ^ Error: Timeout at Timeout._onTimeout ... at ontimeout (timers.js:365:14) at tryOnTimeout (timers.js:237:5) at Timer.listOnTimeout (timers.js:207:5) ``` Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console: PR-URL: #9724 Reviewed-By: Santiago Gimeno <[email protected]>
* Liberal use of common.mustCall() * Rename test-dgram-empty-packet -> test-dgram-send-empty-packet * Remove use of timers to avoid CI failures like seen in the Ref below: ``` not ok 237 parallel/test-dgram-empty-packet --- duration_ms: 0.717 severity: fail stack: |- ... throw new Error('Timeout'); ^ Error: Timeout at Timeout._onTimeout ... at ontimeout (timers.js:365:14) at tryOnTimeout (timers.js:237:5) at Timer.listOnTimeout (timers.js:207:5) ``` Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console: PR-URL: nodejs#9724 Reviewed-By: Santiago Gimeno <[email protected]>
* Liberal use of common.mustCall() * Rename test-dgram-empty-packet -> test-dgram-send-empty-packet * Remove use of timers to avoid CI failures like seen in the Ref below: ``` not ok 237 parallel/test-dgram-empty-packet --- duration_ms: 0.717 severity: fail stack: |- ... throw new Error('Timeout'); ^ Error: Timeout at Timeout._onTimeout ... at ontimeout (timers.js:365:14) at tryOnTimeout (timers.js:237:5) at Timer.listOnTimeout (timers.js:207:5) ``` Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console: PR-URL: #9724 Reviewed-By: Santiago Gimeno <[email protected]>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test dgram
Description of change
Refs: https://ci.nodejs.org/job/node-test-commit-freebsd/5341/nodes=freebsd11-x64/console: