Skip to content

Commit

Permalink
test: fix flaky test-child-process-exec-timeout
Browse files Browse the repository at this point in the history
At least starting with Darwin Kernel Version 16.4.0, sending a SIGTERM
to a process that is still starting up kills it with SIGKILL instead of
SIGTERM.

PR-URL: nodejs/node#12159
Refs: libuv/libuv#1226
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
santigimeno authored and andrew749 committed Jul 19, 2017
1 parent 74a990f commit 053e139
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/parallel/test-child-process-exec-timeout.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ const cmd = `${process.execPath} ${__filename} child`;
cp.exec(cmd, { timeout: 1 }, common.mustCall((err, stdout, stderr) => {
assert.strictEqual(err.killed, true);
assert.strictEqual(err.code, null);
assert.strictEqual(err.signal, 'SIGTERM');
// At least starting with Darwin Kernel Version 16.4.0, sending a SIGTERM to a
// process that is still starting up kills it with SIGKILL instead of SIGTERM.
// See: https://github.com/libuv/libuv/issues/1226
if (common.isOSX)
assert.ok(err.signal === 'SIGTERM' || err.signal === 'SIGKILL');
else
assert.strictEqual(err.signal, 'SIGTERM');
assert.strictEqual(err.cmd, cmd);
assert.strictEqual(stdout.trim(), '');
assert.strictEqual(stderr.trim(), '');
Expand Down

0 comments on commit 053e139

Please sign in to comment.