Skip to content

Commit

Permalink
test: fix flaky test-debug-signal-cluster.js
Browse files Browse the repository at this point in the history
SmartOS sometimes munges output from `process._rawDebug()`
but Windows can't use `console.error()` in the debug agent.
So inject logic to chose the right thing based on platform.

Fixes: nodejs#2476
  • Loading branch information
Trott committed Nov 4, 2015
1 parent 471aa5a commit 8076de4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 8 additions & 1 deletion lib/_debug_agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ exports.start = function start() {

agent.listen(process._debugAPI.port, function() {
var addr = this.address();
process._rawDebug('Debugger listening on port %d', addr.port);
// SmartOS sometimes munges output from `process._rawDebug()`
// but Windows can't use `console.error()`.
// https://github.com/nodejs/node/issues/2476
if (process.platform == 'win32') {
process._rawDebug('Debugger listening on port %d', addr.port);
} else {
console.error('Debugger listening on port %d', addr.port);
}
process._debugAPI.notifyListen();
});

Expand Down
1 change: 0 additions & 1 deletion test/parallel/parallel.status
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8076de4

Please sign in to comment.