diff --git a/test/parallel/test-child-process-fork-net.js b/test/parallel/test-child-process-fork-net.js index c17dba9495..d224643184 100644 --- a/test/parallel/test-child-process-fork-net.js +++ b/test/parallel/test-child-process-fork-net.js @@ -1,5 +1,5 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); const fork = require('child_process').fork; const net = require('net'); @@ -60,9 +60,10 @@ if (process.argv[2] === 'child') { const child = fork(process.argv[1], ['child']); - child.on('exit', function() { - console.log('CHILD: died'); - }); + child.on('exit', common.mustCall(function(code, signal) { + const message = `CHILD: died with ${code}, ${signal}`; + assert.strictEqual(code, 0, message); + })); // send net.Server to child and test by connecting const testServer = function(callback) { @@ -171,7 +172,6 @@ if (process.argv[2] === 'child') { testSocket(function() { socketSuccess = true; - child.kill(); }); });