-
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: refactor/cleanup a number of cluster tests #8261
Conversation
@@ -82,15 +79,15 @@ function worker() { | |||
// Create udp socket and start listening. | |||
var socket = dgram.createSocket('udp4'); | |||
|
|||
socket.on('message', function(data, info) { | |||
socket.on('message', common.mustCall((data, info) => { | |||
received++; | |||
|
|||
// Every 10 messages, notify the master. | |||
if (received == PACKETS_PER_WORKER) { |
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.
Nit: Since you're already working nearby, maybe change ==
to ===
?
|
||
//Kill process when worker is killed | ||
cluster.on('exit', function() { | ||
cluster.on('exit', common.mustCall(() => { | ||
process.exit(0); |
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.
While you're here... I think process.exit(0)
can be removed.
The changes LGTM with a couple of comments / suggestions. |
* Move shared code into common * Favor use of strictEqual * Add some missing common.mustCalls * Other general cleanup
e03376c
to
f6a2c45
Compare
@santigimeno ... updated! PTAL! |
LGTM with one tiny comment that you can ignore. Thanks! |
Trying again due to a build bot failure: https://ci.nodejs.org/job/node-test-pull-request/3913/ |
CI was green. woo! |
* Move shared code into common * Favor use of strictEqual * Add some missing common.mustCalls * Other general cleanup PR-URL: #8261 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Landed in baa0ffd |
Looking at the AIX runs I've seen a few failures of: parallel/test-cluster-dgram-1 I wonder if its related to this change ? |
If the failures are new, entirely possible. Have a stack trace? |
opened this issue to track #8380 |
We've started to see frequent failures in test/parallel/test-cluster-dgram-1.js on AIX since the refactoring in nodejs#8261. Revert changes until we have time to investigate properly.
* Move shared code into common * Favor use of strictEqual * Add some missing common.mustCalls * Other general cleanup PR-URL: nodejs#8261 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
* Move shared code into common * Favor use of strictEqual * Add some missing common.mustCalls * Other general cleanup PR-URL: #8261 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This does not land cleanly in LTS. Added dont-land label. Please feel free to manually backport |
Checklist
make -j4 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test, cluster
Description of change
Some general refactoring / improvements to various cluster related tests: