Skip to content

Commit a35b1a6

Browse files
test: fix test-repl-import-referrer flakiness
1 parent 4c764c8 commit a35b1a6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/parallel/test-repl-import-referrer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,9 @@ child.on('exit', common.mustCall(() => {
2727
);
2828
}));
2929

30-
child.stdin.write('await import(\'./message.mjs\');\n');
31-
child.stdin.write('.exit');
30+
// Note: write the commands on stdin with a slight delay to make sure
31+
// that the child process is ready to receive and process them
32+
setTimeout(() => {
33+
child.stdin.write('await import(\'./message.mjs\');\n');
34+
child.stdin.write('.exit');
35+
}, common.platformTimeout(250));

0 commit comments

Comments
 (0)