test: recommended changes to test-cluster-send-handle-twice.js#10049
test: recommended changes to test-cluster-send-handle-twice.js#10049amarzavery wants to merge 1 commit intonodejs:masterfrom
Conversation
There was a problem hiding this comment.
This change isn't really necessary (although it doesn't hurt anything). Nothing is being asserted in the callback, so the test should fail if it's not called.
There was a problem hiding this comment.
You could have left the 'Worker exited by a signal' as the third argument here.
There was a problem hiding this comment.
This bug was in the original test, but the next line will never execute because common.fail() (and, in the existing test, assert(false, ...)) result in the termination of the program.
|
Maybe @cjihrig @mcollina or @bnoordhuis can give this a quick review? (Looping in the people suggested for cluster stuff in onboarding-extras.md.) |
cjihrig
left a comment
There was a problem hiding this comment.
LGTM if the CI is happy.
- `var` --> `const` as applicable - `assert.equal` --> `assert.strictEqual` - `assert(false, ..)` --> `common.fail()` - `common.mustCall` for functions that need to be called exactly once - modified an `assert(!signal, 'Worker exited by a signal');` call to `assert.strictEqual(signal, null);` call as that made more sense PR-URL: nodejs#10049 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
|
Landed in 7e7062c. |
- `var` --> `const` as applicable - `assert.equal` --> `assert.strictEqual` - `assert(false, ..)` --> `common.fail()` - `common.mustCall` for functions that need to be called exactly once - modified an `assert(!signal, 'Worker exited by a signal');` call to `assert.strictEqual(signal, null);` call as that made more sense PR-URL: #10049 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- `var` --> `const` as applicable - `assert.equal` --> `assert.strictEqual` - `assert(false, ..)` --> `common.fail()` - `common.mustCall` for functions that need to be called exactly once - modified an `assert(!signal, 'Worker exited by a signal');` call to `assert.strictEqual(signal, null);` call as that made more sense PR-URL: #10049 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- `var` --> `const` as applicable - `assert.equal` --> `assert.strictEqual` - `assert(false, ..)` --> `common.fail()` - `common.mustCall` for functions that need to be called exactly once - modified an `assert(!signal, 'Worker exited by a signal');` call to `assert.strictEqual(signal, null);` call as that made more sense PR-URL: #10049 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- `var` --> `const` as applicable - `assert.equal` --> `assert.strictEqual` - `assert(false, ..)` --> `common.fail()` - `common.mustCall` for functions that need to be called exactly once - modified an `assert(!signal, 'Worker exited by a signal');` call to `assert.strictEqual(signal, null);` call as that made more sense PR-URL: #10049 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- `var` --> `const` as applicable - `assert.equal` --> `assert.strictEqual` - `assert(false, ..)` --> `common.fail()` - `common.mustCall` for functions that need to be called exactly once - modified an `assert(!signal, 'Worker exited by a signal');` call to `assert.strictEqual(signal, null);` call as that made more sense PR-URL: #10049 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- `var` --> `const` as applicable - `assert.equal` --> `assert.strictEqual` - `assert(false, ..)` --> `common.fail()` - `common.mustCall` for functions that need to be called exactly once - modified an `assert(!signal, 'Worker exited by a signal');` call to `assert.strictEqual(signal, null);` call as that made more sense PR-URL: #10049 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
- `var` --> `const` as applicable - `assert.equal` --> `assert.strictEqual` - `assert(false, ..)` --> `common.fail()` - `common.mustCall` for functions that need to be called exactly once - modified an `assert(!signal, 'Worker exited by a signal');` call to `assert.strictEqual(signal, null);` call as that made more sense PR-URL: #10049 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Checklist
make -j8 test(UNIX), orvcbuild test nosign(Windows) passesAffected core subsystem(s)
Description of change
var-->constas applicableassert.equal-->assert.strictEqualassert(false, ..)-->common.fail()common.mustCallfor functions that need to be called exactly onceassert(!signal, 'Worker exited by a signal');call toassert.strictEqual(signal, null);call as that made more sense