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: https://github.com/nodejs/node/pull/52185
Refs: https://github.com/nodejs/node/pull/47164
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
This commit is contained in:
cjihrig authored and Node.js GitHub Bot committed 2024-03-25 01:01:41 +00:00
1 parent 5905596719
commit 4648c83dbc
1 file changed
+5 -1
+5 -1
View File
@@ -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) {