Commit e51d8c6 1 parent 1f4f811 commit e51d8c6 Copy full SHA for e51d8c6
File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -7,13 +7,16 @@ const {
7
7
ArrayPrototypeSlice,
8
8
ArrayPrototypeSort,
9
9
Promise,
10
+ PromiseAll,
11
+ SafeArrayIterator,
10
12
SafeSet,
11
13
} = primordials ;
12
14
const {
13
15
prepareMainThreadExecution,
14
16
} = require ( 'internal/bootstrap/pre_execution' ) ;
15
17
const { spawn } = require ( 'child_process' ) ;
16
18
const { readdirSync, statSync } = require ( 'fs' ) ;
19
+ const { finished } = require ( 'internal/streams/end-of-stream' ) ;
17
20
const console = require ( 'internal/console/global' ) ;
18
21
const {
19
22
codes : {
@@ -126,9 +129,10 @@ function runTestFile(path) {
126
129
stderr += chunk ;
127
130
} ) ;
128
131
129
- child . once ( 'exit' , ( code , signal ) => {
132
+ child . once ( 'exit' , async ( code , signal ) => {
130
133
if ( code !== 0 || signal !== null ) {
131
134
if ( ! err ) {
135
+ await PromiseAll ( new SafeArrayIterator ( [ finished ( child . stderr ) , finished ( child . stdout ) ] ) ) ;
132
136
err = new ERR_TEST_FAILURE ( 'test failed' , kSubtestsFailed ) ;
133
137
err . exitCode = code ;
134
138
err . signal = signal ;
You can’t perform that action at this time.
0 commit comments