Skip to content

Commit 1389a4f

Browse files
Trottevanlucas
authored andcommitted
test: fix flaky test-preload
Use `close` event rather than `exit` event to make sure all output has been received before checking assertions. PR-URL: #6728 Fixes: #6722 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent adb2d61 commit 1389a4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/parallel/test-preload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var stdinStdout = '';
8181
stdinProc.stdout.on('data', function(d) {
8282
stdinStdout += d;
8383
});
84-
stdinProc.on('exit', function(code) {
84+
stdinProc.on('close', function(code) {
8585
assert.equal(code, 0);
8686
assert.equal(stdinStdout, 'A\nhello\n');
8787
});
@@ -97,7 +97,7 @@ var replStdout = '';
9797
replProc.stdout.on('data', function(d) {
9898
replStdout += d;
9999
});
100-
replProc.on('exit', function(code) {
100+
replProc.on('close', function(code) {
101101
assert.equal(code, 0);
102102
const output = [
103103
'A',

0 commit comments

Comments
 (0)