Skip to content

Commit

Permalink
test: fix flaky child-process-exec-kill-throws
Browse files Browse the repository at this point in the history
Kill the child process with `SIGKILL` to make sure the child process
does not remain alive.

Fixes: #20139

PR-URL: #20213
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Weijia Wang <starkwang@126.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
santigimeno authored and MylesBorins committed May 4, 2018
1 parent e17280e commit 769b6c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/parallel/test-child-process-exec-kill-throws.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ if (process.argv[2] === 'child') {
};

const cmd = `"${process.execPath}" "${__filename}" child`;
const options = { maxBuffer: 0 };
const options = { maxBuffer: 0, killSignal: 'SIGKILL' };

const child = cp.exec(cmd, options, common.mustCall((err, stdout, stderr) => {
// Verify that if ChildProcess#kill() throws, the error is reported.
assert.strictEqual(err.message, 'mock error', err);
Expand Down

0 comments on commit 769b6c8

Please sign in to comment.