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:
Rich Trott 2018-04-18 10:53:01 -07:00
parent 2652ab3c45
commit 6e6913b5db
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
setInterval(function() {}, 500);
setInterval(function() {}, 9999);

View File

@ -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');
}
{