Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix flaky test-preload
Use `close` event rather than `exit` event to make sure all output has
been received before checking assertions.

Fixes: #6722
  • Loading branch information
Trott committed May 13, 2016
commit e614e65de2d7146b76c12c7111a89fdccdb4b759
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