Skip to content

Commit 82c52b5

Browse files
Trottjasnell
authored andcommitted
test: fix test-child-process-send-returns-boolean
test-child-process-send-returns-boolean was unreliable in CI and locally. * use 'SIGKILL' for more reliable process termination * replace callback with assert.ifError() * increase interval in fixture from 500ms to 9999ms. It's only purpose is to keep the process from exiting. Fixes: #20135 PR-URL: #20136 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
1 parent 9214d64 commit 82c52b5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
setInterval(function() {}, 500);
1+
setInterval(function() {}, 9999);

test/parallel/test-child-process-send-returns-boolean.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ const subScript = fixtures.path('child-process-persistent.js');
1717
// Test `send` return value on `fork` that opens and IPC by default.
1818
const n = fork(subScript);
1919
// `subprocess.send` should always return `true` for the first send.
20-
const rv = n.send({ h: 'w' }, (err) => { if (err) assert.fail(err); });
20+
const rv = n.send({ h: 'w' }, assert.ifError);
2121
assert.strictEqual(rv, true);
22-
n.kill();
22+
n.kill('SIGKILL');
2323
}
2424

2525
{

0 commit comments

Comments
 (0)