@@ -13,6 +13,7 @@ const {
13
13
ObjectAssign,
14
14
ObjectKeys,
15
15
PromisePrototypeThen,
16
+ SafePromiseAll,
16
17
SafePromiseAllReturnVoid,
17
18
SafePromiseAllSettledReturnVoid,
18
19
SafeMap,
@@ -24,6 +25,7 @@ const {
24
25
25
26
const { spawn } = require ( 'child_process' ) ;
26
27
const { readdirSync, statSync } = require ( 'fs' ) ;
28
+ const { finished } = require ( 'internal/streams/end-of-stream' ) ;
27
29
// TODO(aduh95): switch to internal/readline/interface when backporting to Node.js 16.x is no longer a concern.
28
30
const { createInterface } = require ( 'readline' ) ;
29
31
const { FilesWatcher } = require ( 'internal/watch_mode/files_watcher' ) ;
@@ -299,7 +301,10 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
299
301
subtest . addToReport ( ast ) ;
300
302
} ) ;
301
303
302
- const { 0 : code , 1 : signal } = await once ( child , 'exit' , { signal : t . signal } ) ;
304
+ const { 0 : { 0 : code , 1 : signal } } = await SafePromiseAll ( [
305
+ once ( child , 'exit' , { signal : t . signal } ) ,
306
+ finished ( parser , { signal : t . signal } ) ,
307
+ ] ) ;
303
308
304
309
runningProcesses . delete ( path ) ;
305
310
runningSubtests . delete ( path ) ;
0 commit comments