Skip to content
Merged
Changes from 1 commit
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
Next Next commit
test_runner: wait for stderr and stdout to complete
  • Loading branch information
MoLow committed Jul 4, 2022
commit b82a40f753bd7fba287ab07024b495b25d455fed
5 changes: 4 additions & 1 deletion lib/internal/main/test_runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ const {
ArrayPrototypeSlice,
ArrayPrototypeSort,
Promise,
PromiseAll,
Comment thread
MoLow marked this conversation as resolved.
SafeSet,
} = primordials;
const {
prepareMainThreadExecution,
} = require('internal/bootstrap/pre_execution');
const { spawn } = require('child_process');
const { readdirSync, statSync } = require('fs');
const { finished } = require('internal/streams/end-of-stream');
const console = require('internal/console/global');
const {
codes: {
Expand Down Expand Up @@ -126,9 +128,10 @@ function runTestFile(path) {
stderr += chunk;
});

child.once('exit', (code, signal) => {
child.once('exit', async (code, signal) => {
if (code !== 0 || signal !== null) {
if (!err) {
await PromiseAll([finished(child.stderr), finished(child.stdout)]);
Comment thread
MoLow marked this conversation as resolved.
Outdated
err = new ERR_TEST_FAILURE('test failed', kSubtestsFailed);
err.exitCode = code;
err.signal = signal;
Expand Down