Skip to content

Commit

Permalink
test: check number of message events
Browse files Browse the repository at this point in the history
When a no-op message event handler is used in a test, make it clear what
is expected by using `common.mustCall()` and `common.mustNotCall()`.

PR-URL: #13125
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and addaleax committed May 23, 2017
1 parent 47919b3 commit b5b6f5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/parallel/test-child-process-fork-ref2.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if (process.argv[2] === 'child') {

setTimeout(function() {
console.log('child -> will this keep it alive?');
process.on('message', common.noop);
process.on('message', common.mustNotCall());
}, 400);

} else {
Expand Down
2 changes: 1 addition & 1 deletion test/sequential/test-child-process-pass-fd.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if (process.argv[2] !== 'child') {
// the only thing keeping this worker alive will be IPC. This is important,
// because it means a worker with no parent will have no referenced handles,
// thus no work to do, and will exit immediately, preventing process leaks.
process.on('message', common.noop);
process.on('message', common.mustCall());

const server = net.createServer((c) => {
process.once('message', function(msg) {
Expand Down

0 comments on commit b5b6f5d

Please sign in to comment.