test: fix flaky test-cluster-send-handle-twice
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: https://github.com/nodejs/node/pull/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>
parent
0bcad33c
Please register or sign in to comment