Skip to content

Commit

Permalink
test: fix flaky test-preload
Browse files Browse the repository at this point in the history
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 <santiago.gimeno@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
Trott committed May 13, 2016
1 parent 084b2ec commit b5a75ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ var stdinStdout = '';
stdinProc.stdout.on('data', function(d) {
stdinStdout += d;
});
stdinProc.on('exit', function(code) {
stdinProc.on('close', function(code) {
assert.equal(code, 0);
assert.equal(stdinStdout, 'A\nhello\n');
});
Expand All @@ -97,7 +97,7 @@ var replStdout = '';
replProc.stdout.on('data', function(d) {
replStdout += d;
});
replProc.on('exit', function(code) {
replProc.on('close', function(code) {
assert.equal(code, 0);
const output = [
'A',
Expand Down

0 comments on commit b5a75ba

Please sign in to comment.