mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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: https://github.com/nodejs/node/issues/20135 PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
2652ab3c45
commit
6e6913b5db
2
test/fixtures/child-process-persistent.js
vendored
2
test/fixtures/child-process-persistent.js
vendored
@ -1 +1 @@
|
||||
setInterval(function() {}, 500);
|
||||
setInterval(function() {}, 9999);
|
||||
|
@ -17,9 +17,9 @@ const subScript = fixtures.path('child-process-persistent.js');
|
||||
// Test `send` return value on `fork` that opens and IPC by default.
|
||||
const n = fork(subScript);
|
||||
// `subprocess.send` should always return `true` for the first send.
|
||||
const rv = n.send({ h: 'w' }, (err) => { if (err) assert.fail(err); });
|
||||
const rv = n.send({ h: 'w' }, assert.ifError);
|
||||
assert.strictEqual(rv, true);
|
||||
n.kill();
|
||||
n.kill('SIGKILL');
|
||||
}
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user