From 96fe017f8d9937db8d10c26d5ab0186f90596ef6 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 --- 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);