-
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-cluster-send-handle-twice #19700
Conversation
Use `common.mustCall()` to make sure connection callback runs exactly once. Use `connect` event instead of `setTimeout` to avoid test failing if timer runs before client is connected. Remove `cluster.worker.disconnect()` after `assert.fail()`. It is unreachable code that is unnecessary.
Example failure of the current form of the test in CI: https://ci.nodejs.org/job/node-test-commit-freebsd/16565/nodes=freebsd10-64/console not ok 474 parallel/test-cluster-send-handle-twice
---
duration_ms: 120.28
severity: fail
stack: |-
timeout
... |
Failure of current form of test reproduced locally:
|
Success of test in this PR locally: $ tools/test.py -j 96 --repeat 192 test/parallel/test-cluster-send-handle-twice.js
[00:17|% 100|+ 192|- 0]: Done
$ |
process.send('send-handle-1', socket); | ||
process.send('send-handle-2', socket); | ||
}); | ||
})); |
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.
This is very likely tested for very very often already.
Single CI failure seems unrelated. Re-running just that task: https://ci.nodejs.org/job/node-test-commit-plinux/16508/ (EDIT: Re-run is green.) |
Use `common.mustCall()` to make sure connection callback runs exactly once. Use `connect` event instead of `setTimeout` to avoid test failing if timer runs before client is connected. Remove `cluster.worker.disconnect()` after `assert.fail()`. It is unreachable code that is unnecessary. PR-URL: nodejs#19700 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in 4d749e1 |
Use `common.mustCall()` to make sure connection callback runs exactly once. Use `connect` event instead of `setTimeout` to avoid test failing if timer runs before client is connected. Remove `cluster.worker.disconnect()` after `assert.fail()`. It is unreachable code that is unnecessary. PR-URL: #19700 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Use `common.mustCall()` to make sure connection callback runs exactly once. Use `connect` event instead of `setTimeout` to avoid test failing if timer runs before client is connected. Remove `cluster.worker.disconnect()` after `assert.fail()`. It is unreachable code that is unnecessary. PR-URL: #19700 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Use
common.mustCall()
to make sure connection callback runs exactlyonce.
Use
connect
event instead ofsetTimeout
to avoid test failing iftimer runs before client is connected.
Remove
cluster.worker.disconnect()
afterassert.fail()
. It isunreachable code that is unnecessary.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes