Skip to content

Commit b15dc95

Browse files
santigimenoitaloacasas
authored andcommitted
test: fix flaky test-child-process-exec-timeout
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: #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]>
1 parent 72a27b3 commit b15dc95

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/parallel/test-child-process-exec-timeout.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ const cmd = `${process.execPath} ${__filename} child`;
1818
cp.exec(cmd, { timeout: 1 }, common.mustCall((err, stdout, stderr) => {
1919
assert.strictEqual(err.killed, true);
2020
assert.strictEqual(err.code, null);
21-
assert.strictEqual(err.signal, 'SIGTERM');
21+
// At least starting with Darwin Kernel Version 16.4.0, sending a SIGTERM to a
22+
// process that is still starting up kills it with SIGKILL instead of SIGTERM.
23+
// See: https://github.com/libuv/libuv/issues/1226
24+
if (common.isOSX)
25+
assert.ok(err.signal === 'SIGTERM' || err.signal === 'SIGKILL');
26+
else
27+
assert.strictEqual(err.signal, 'SIGTERM');
2228
assert.strictEqual(err.cmd, cmd);
2329
assert.strictEqual(stdout.trim(), '');
2430
assert.strictEqual(stderr.trim(), '');

0 commit comments

Comments
 (0)