★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/2009f18064Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
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>
  • Loading branch information
addaleax committed Feb 6, 2019
1 parent 7035496 commit 2009f18064f6ae7b18c3fda7991c1cdca4fb95e6
Showing with 2 additions and 2 deletions.
  1. +2 −2 test/parallel/test-trace-events-category-used.js
@@ -28,7 +28,7 @@ let procEnabledOutput = '';

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

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

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

0 comments on commit 2009f18

Please sign in to comment.