diff --git a/test/parallel/test-debug-port-from-cmdline.js b/test/parallel/test-debug-port-from-cmdline.js index deb7ae241a5..71ed71bd63a 100644 --- a/test/parallel/test-debug-port-from-cmdline.js +++ b/test/parallel/test-debug-port-from-cmdline.js @@ -4,11 +4,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'); @@ -23,6 +23,7 @@ child.on('message', function onChildMsg(message) { process.on('exit', function() { child.kill(); + assertOutputLines(); }); var outputLines = []; @@ -31,7 +32,6 @@ function processStderrLine(line) { outputLines.push(line); if (/Debugger listening/.test(line)) { - assertOutputLines(); process.exit(); } }