From 98c6a81771513622fbc21b01f623447ed38b70c4 Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 8 Mar 2013 09:29:13 -0800 Subject: [PATCH] test: Kill zombies when debugger-client fails on windows --- test/simple/test-debugger-client.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/simple/test-debugger-client.js b/test/simple/test-debugger-client.js index 8b4ba2c19c..fd18ec1579 100644 --- a/test/simple/test-debugger-client.js +++ b/test/simple/test-debugger-client.js @@ -162,7 +162,15 @@ function doTest(cb, done) { nodeProcess.stdout.once('data', function(c) { console.log('>>> new node process: %d', nodeProcess.pid); - process._debugProcess(nodeProcess.pid); + var failed = true; + try { + process._debugProcess(nodeProcess.pid); + failed = false; + } finally { + // At least TRY not to leave zombie procs if this fails. + if (failed) + nodeProcess.kill('SIGTERM'); + } console.log('>>> starting debugger session'); });