Skip to content

Commit 06d77b8

Browse files
committed
test: fix flaky test-repl-sigint-nested-eval
There is a race condition where process.kill can be sent before the target is ready to receive the signal. Or at least that's what I think is going on. Regardless, objectively, using setTimeout() to slightly delay the invocation causes the test to not fail anymore using: tools/test.py --repeat=1000 test/parallel/test-repl-sigint-nested-eval Fixes: #41123
1 parent e1ac4e9 commit 06d77b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/parallel/test-repl-sigint-nested-eval.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ child.stdout.on('data', function(c) {
2323

2424
child.stdout.once('data', common.mustCall(() => {
2525
process.on('SIGUSR2', common.mustCall(() => {
26-
process.kill(child.pid, 'SIGINT');
26+
setTimeout(() => { process.kill(child.pid, 'SIGINT'); }, 10);
2727
child.stdout.once('data', common.mustCall(() => {
2828
// Make sure REPL still works.
2929
child.stdin.end('"foobar"\n');

0 commit comments

Comments
 (0)