From 769b6c8fd2e0a9282e64cb622cfad8b002748677 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Sun, 22 Apr 2018 22:22:25 +0200 Subject: [PATCH] test: fix flaky child-process-exec-kill-throws Kill the child process with `SIGKILL` to make sure the child process does not remain alive. Fixes: https://github.com/nodejs/node/issues/20139 PR-URL: https://github.com/nodejs/node/pull/20213 Reviewed-By: Rich Trott Reviewed-By: Luigi Pinca Reviewed-By: Trivikram Kamat Reviewed-By: Weijia Wang Reviewed-By: James M Snell --- test/parallel/test-child-process-exec-kill-throws.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-child-process-exec-kill-throws.js b/test/parallel/test-child-process-exec-kill-throws.js index 35e5ff8b7bce0f..d6a0d4da19eae7 100644 --- a/test/parallel/test-child-process-exec-kill-throws.js +++ b/test/parallel/test-child-process-exec-kill-throws.js @@ -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);