-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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: added in a better template value for a test message #16826
Conversation
Commit message is too long. |
@@ -81,7 +81,8 @@ if (cluster.isWorker) { | |||
process.once('exit', () => { | |||
assert.strictEqual(typeof pid, 'number', | |||
`got ${pid} instead of a worker pid`); | |||
assert.strictEqual(alive, false, 'worker was alive after master died'); | |||
assert.strictEqual(alive, false, | |||
`${alive} worker was alive after master died`); |
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.
I could be misunderstanding something but wouldn't this just result in true worker was alive after master died
? That said I'm not certain what the request was at the Code & Learn.
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.
probably the intent is to print the actual value of alive
to aid diagnostics, but in this case looks like it is redundant - as the value is evident (true
, as equating to false
was resulted in false
) and can be inferred statically.
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.
Theoretically, at least, isAlive()
could return any value. Printing it here may be a bit much, though. I guess it could be:
assert.strictEqual(alive, false, `worker was alive after master died (alive = ${alive})`);
I'd be 👍 on that change.
Include value that cause failure in error message in test-cluster-master-kill.js. PR-URL: nodejs#16826 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Landed in f7436ba. Thanks for the contribution! 🎉 |
Include value that cause failure in error message in test-cluster-master-kill.js. PR-URL: #16826 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Include value that cause failure in error message in test-cluster-master-kill.js. PR-URL: #16826 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Include value that cause failure in error message in test-cluster-master-kill.js. PR-URL: #16826 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Include value that cause failure in error message in test-cluster-master-kill.js. PR-URL: #16826 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Include value that cause failure in error message in test-cluster-master-kill.js. PR-URL: #16826 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test