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 <rtrott@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 72a27b3 commit b15dc95

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: 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)