diff options
author | Santiago Gimeno <santiago.gimeno@gmail.com> | 2017-04-01 20:44:36 +0200 |
---|---|---|
committer | Santiago Gimeno <santiago.gimeno@gmail.com> | 2017-04-04 15:02:35 +0200 |
commit | 45c4ad58e5bd53763c4264e5733b8c118fdf8291 (patch) | |
tree | ac1c7ccd562b3d2cb8aa5315c1dda49cc30caea2 /test | |
parent | f7a31180adc63d393e01a71f3694447a723b33b5 (diff) | |
download | android-node-v8-45c4ad58e5bd53763c4264e5733b8c118fdf8291.tar.gz android-node-v8-45c4ad58e5bd53763c4264e5733b8c118fdf8291.tar.bz2 android-node-v8-45c4ad58e5bd53763c4264e5733b8c118fdf8291.zip |
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: https://github.com/nodejs/node/pull/12159
Refs: https://github.com/libuv/libuv/issues/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>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-child-process-exec-timeout.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/parallel/test-child-process-exec-timeout.js b/test/parallel/test-child-process-exec-timeout.js index b28fdf6581..63534d8cbc 100644 --- a/test/parallel/test-child-process-exec-timeout.js +++ b/test/parallel/test-child-process-exec-timeout.js @@ -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(), ''); |