Skip to content

Commit

Permalink
test_runner: don't await the same promise for each test
Browse files Browse the repository at this point in the history
Prior to this commit, each top level test awaited the same
global promise for setting up test reporters. This commit
updates the logic to only await the promise the first time
it is encountered.
  • Loading branch information
cjihrig committed Mar 22, 2024
1 parent b7d0808 commit ed1821a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/internal/test_runner/harness.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,11 @@ function getGlobalRoot() {
}

async function startSubtest(subtest) {
await reportersSetup;
if (reportersSetup) {
// Only incur the overhead of awaiting the Promise once.
await reportersSetup;
reportersSetup = undefined;
}

const root = getGlobalRoot();
if (!root.harness.bootstrapComplete) {
Expand Down

0 comments on commit ed1821a

Please sign in to comment.