Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix flaky test-child-process-exec-timeout #12159

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]>
santigimeno committed Apr 4, 2017

Verified

This commit was signed with the committer’s verified signature.
santigimeno Santiago Gimeno
commit 45c4ad58e5bd53763c4264e5733b8c118fdf8291
8 changes: 7 additions & 1 deletion test/parallel/test-child-process-exec-timeout.js
Original file line number Diff line number Diff line change
@@ -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(), '');