diff --git a/test/fixtures/clustered-server/app.js b/test/fixtures/clustered-server/app.js index 86d66c5e88..4053cd3af2 100644 --- a/test/fixtures/clustered-server/app.js +++ b/test/fixtures/clustered-server/app.js @@ -13,9 +13,6 @@ if (cluster.isMaster) { cluster.on('online', function() { if (++workersOnline === NUMBER_OF_WORKERS) { console.error('all workers are running'); - for (var key in cluster.workers) { - cluster.workers[key].disconnect(); - } } }); diff --git a/test/simple/test-debug-cluster.js b/test/simple/test-debug-cluster.js index 18e8ffaef0..c0963c35a9 100644 --- a/test/simple/test-debug-cluster.js +++ b/test/simple/test-debug-cluster.js @@ -35,11 +35,16 @@ child.stderr.on('data', function(data) { if (line === 'all workers are running') { assertOutputLines(); + process.exit(); } else { outputLines = outputLines.concat(lines); } }); +process.on('exit', function onExit() { + child.kill(); +}); + var assertOutputLines = common.mustCall(function() { var expectedLines = [ 'Debugger listening on port ' + 5858, diff --git a/test/simple/test-debug-port-cluster.js b/test/simple/test-debug-port-cluster.js index 7e71dffd55..34ae3a0293 100644 --- a/test/simple/test-debug-port-cluster.js +++ b/test/simple/test-debug-port-cluster.js @@ -41,11 +41,16 @@ child.stderr.on('data', function(data) { if (line === 'all workers are running') { assertOutputLines(); + process.exit(); } else { outputLines = outputLines.concat(lines); } }); +process.on('exit', function onExit() { + child.kill(); +}); + var assertOutputLines = common.mustCall(function() { var expectedLines = [ 'Debugger listening on port ' + port,