From 454fbb803a1bef3bd53224b73fc48093c250d507 Mon Sep 17 00:00:00 2001 From: Rod Vagg Date: Sat, 8 Nov 2014 20:03:20 +1100 Subject: [PATCH] test: kill children before cluster parent Killing the cluster master first on Windows causes an ESRCH when killing the children as the OS takes care of them itself. PR-URL: https://github.com/node-forward/node/pull/53 Reviewed-By: Ben Noordhuis --- test/simple/test-debug-signal-cluster.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/simple/test-debug-signal-cluster.js b/test/simple/test-debug-signal-cluster.js index 27d53910b7..cd57e548a9 100644 --- a/test/simple/test-debug-signal-cluster.js +++ b/test/simple/test-debug-signal-cluster.js @@ -73,7 +73,9 @@ setTimeout(function testTimedOut() { }, 6000); process.on('exit', function onExit() { - pids.forEach(function(pid) { + // Kill processes in reverse order to avoid timing problems on Windows where + // the parent process is killed before the children. + pids.reverse().forEach(function(pid) { process.kill(pid); }); });