diff --git a/test/parallel/test-child-process-fork-ref2.js b/test/parallel/test-child-process-fork-ref2.js index 9f59aa344aa2c9..cf50a17ad00c64 100644 --- a/test/parallel/test-child-process-fork-ref2.js +++ b/test/parallel/test-child-process-fork-ref2.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); const fork = require('child_process').fork; if (process.argv[2] === 'child') { @@ -8,7 +8,7 @@ if (process.argv[2] === 'child') { setTimeout(function() { console.log('child -> will this keep it alive?'); - process.on('message', function() { }); + process.on('message', common.mustNotCall()); }, 400); } else { diff --git a/test/sequential/test-child-process-pass-fd.js b/test/sequential/test-child-process-pass-fd.js index 2d05407e67b99f..b2481270faf065 100644 --- a/test/sequential/test-child-process-pass-fd.js +++ b/test/sequential/test-child-process-pass-fd.js @@ -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) {