mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
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: https://github.com/nodejs/node/pull/6728 Fixes: https://github.com/nodejs/node/issues/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>
This commit is contained in:
1 parent
adb2d610e6
commit
1389a4fc5e
1 file changed
+2
-2
@@ -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');
|
||||
});
|
||||
@@ -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',
|
||||
|
||||
Reference in new issue
Block a user