Skip to content

Commit 769b6c8

Browse files
santigimenoMylesBorins
authored andcommitted
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: #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>
1 parent e17280e commit 769b6c8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎test/parallel/test-child-process-exec-kill-throws.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ if (process.argv[2] === 'child') {
1919
};
2020

2121
constcmd=`"${process.execPath}" "${__filename}" child`;
22-
constoptions={maxBuffer: 0};
22+
constoptions={maxBuffer: 0,killSignal: 'SIGKILL'};
23+
2324
constchild=cp.exec(cmd,options,common.mustCall((err,stdout,stderr)=>{
2425
// Verify that if ChildProcess#kill() throws, the error is reported.
2526
assert.strictEqual(err.message,'mock error',err);

0 commit comments

Comments
 (0)