Skip to content

Commit a501860

Browse files
cjihrigmarco-ippolito
authored andcommitted
test_runner: don't await the same promise for each test
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. PR-URL: #52185 Refs: #47164 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent 053282e commit a501860

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/internal/test_runner/harness.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,11 @@ function getGlobalRoot() {
233233
}
234234

235235
async function startSubtest(subtest) {
236-
await reportersSetup;
236+
if (reportersSetup) {
237+
// Only incur the overhead of awaiting the Promise once.
238+
await reportersSetup;
239+
reportersSetup = undefined;
240+
}
237241

238242
const root = getGlobalRoot();
239243
if (!root.harness.bootstrapComplete) {

0 commit comments

Comments
 (0)