diff --git a/test/simple/test-debug-port-from-cmdline.js b/test/simple/test-debug-port-from-cmdline.js index 54ac2d5d6df934..8200f121668e5d 100644 --- a/test/simple/test-debug-port-from-cmdline.js +++ b/test/simple/test-debug-port-from-cmdline.js @@ -24,11 +24,11 @@ var assert = require('assert'); var spawn = require('child_process').spawn; var debugPort = common.PORT; -var args = ['--debug-port=' + debugPort]; +var args = ['--interactive', '--debug-port=' + debugPort]; var childOptions = { stdio: ['pipe', 'pipe', 'pipe', 'ipc'] }; var child = spawn(process.execPath, args, childOptions); -child.stdin.end("process.send({ msg: 'childready' });"); +child.stdin.write("process.send({ msg: 'childready' });\n"); child.stderr.on('data', function(data) { var lines = data.toString().replace(/\r/g, '').trim().split('\n'); @@ -43,6 +43,7 @@ child.on('message', function onChildMsg(message) { process.on('exit', function() { child.kill(); + assertOutputLines(); }); var outputLines = []; @@ -51,7 +52,6 @@ function processStderrLine(line) { outputLines.push(line); if (/Debugger listening/.test(line)) { - assertOutputLines(); process.exit(); } }