Skip to content

Commit 2009f18

Browse files
committedFeb 6, 2019
test,tracing: use close event to wait for stdio
Use `'close'` rather than `'exit'` to make sure that all stdio has been captured by the time that the event handler is run. PR-URL: #25894 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 7035496 commit 2009f18

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎test/parallel/test-trace-events-category-used.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let procEnabledOutput = '';
2828

2929
procEnabled.stdout.on('data', (data) => procEnabledOutput += data);
3030
procEnabled.stderr.pipe(process.stderr);
31-
procEnabled.once('exit', common.mustCall(() => {
31+
procEnabled.once('close', common.mustCall(() => {
3232
assert.strictEqual(procEnabledOutput, 'true\n');
3333
}));
3434

@@ -46,6 +46,6 @@ let procDisabledOutput = '';
4646

4747
procDisabled.stdout.on('data', (data) => procDisabledOutput += data);
4848
procDisabled.stderr.pipe(process.stderr);
49-
procDisabled.once('exit', common.mustCall(() => {
49+
procDisabled.once('close', common.mustCall(() => {
5050
assert.strictEqual(procDisabledOutput, 'false\n');
5151
}));

0 commit comments

Comments
 (0)