Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

d1b1
Copy link
Contributor

@d1b1 d1b1 commented Nov 6, 2017

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Nov 6, 2017
@mscdex
Copy link
Contributor

mscdex commented Nov 6, 2017

Commit message is too long.

@mscdex mscdex added the cluster Issues and PRs related to the cluster subsystem. label Nov 6, 2017
@gireeshpunathil gireeshpunathil added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 6, 2017
@@ -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`);
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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.

@Trott
Copy link
Member

Trott commented Nov 8, 2017

Trott pushed a commit to Trott/io.js that referenced this pull request Nov 11, 2017
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>
@Trott
Copy link
Member

Trott commented Nov 11, 2017

Landed in f7436ba.

Thanks for the contribution! 🎉

@Trott Trott closed this Nov 11, 2017
evanlucas pushed a commit that referenced this pull request Nov 13, 2017
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>
@evanlucas evanlucas mentioned this pull request Nov 13, 2017
MylesBorins pushed a commit that referenced this pull request Nov 17, 2017
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>
MylesBorins pushed a commit that referenced this pull request Nov 17, 2017
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>
@gibfahn gibfahn mentioned this pull request Nov 21, 2017
@MylesBorins MylesBorins mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
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>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cluster Issues and PRs related to the cluster subsystem. code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants