diff --git a/lib/_debug_agent.js b/lib/_debug_agent.js index 63c50357894b08..cb397bcb8011fa 100644 --- a/lib/_debug_agent.js +++ b/lib/_debug_agent.js @@ -7,7 +7,12 @@ const Buffer = require('buffer').Buffer; const Transform = require('stream').Transform; exports.start = function start() { - var agent = new Agent(); + const agent = new Agent(); + + // SmartOS sometimes munges output from `process._rawDebug()` + // but Windows can't use `console.error()`. + // https://github.com/nodejs/node/issues/2476 + const log = process.platform === 'win32' ? process._rawDebug : console.error; // Do not let `agent.listen()` request listening from cluster master const cluster = require('cluster'); @@ -15,12 +20,12 @@ exports.start = function start() { cluster.isMaster = true; agent.on('error', function(err) { - process._rawDebug(err.stack || err); + log(err.stack || err); }); agent.listen(process._debugAPI.port, function() { - var addr = this.address(); - process._rawDebug('Debugger listening on port %d', addr.port); + const addr = this.address(); + log(`Debugger listening on port ${addr.port}`); process._debugAPI.notifyListen(); }); diff --git a/test/parallel/parallel.status b/test/parallel/parallel.status index 69a154730658d2..9334614d5626d8 100644 --- a/test/parallel/parallel.status +++ b/test/parallel/parallel.status @@ -18,7 +18,6 @@ test-child-process-exit-code : PASS,FLAKY [$system==macos] [$system==solaris] # Also applies to SmartOS -test-debug-signal-cluster : PASS,FLAKY [$system==freebsd] test-net-socket-local-address : PASS,FLAKY