Skip to content

Commit

Permalink
test_runner: wait for parser to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLow committed Feb 19, 2023
1 parent b4a962d commit afc52f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const {
ObjectAssign,
ObjectKeys,
PromisePrototypeThen,
SafePromiseAll,
SafePromiseAllReturnVoid,
SafePromiseAllSettledReturnVoid,
SafeMap,
Expand All @@ -24,6 +25,7 @@ const {

const { spawn } = require('child_process');
const { readdirSync, statSync } = require('fs');
const { finished } = require('internal/streams/end-of-stream');
// TODO(aduh95): switch to internal/readline/interface when backporting to Node.js 16.x is no longer a concern.
const { createInterface } = require('readline');
const { FilesWatcher } = require('internal/watch_mode/files_watcher');
Expand Down Expand Up @@ -299,7 +301,10 @@ function runTestFile(path, root, inspectPort, filesWatcher) {
subtest.addToReport(ast);
});

const { 0: code, 1: signal } = await once(child, 'exit', { signal: t.signal });
const { 0: { 0: code, 1: signal } } = await SafePromiseAll([
once(child, 'exit', { signal: t.signal }),
finished(parser, { signal: t.signal }),
]);

runningProcesses.delete(path);
runningSubtests.delete(path);
Expand Down

0 comments on commit afc52f4

Please sign in to comment.