mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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:
1 parent
5905596719
commit
4648c83dbc
1 file changed
+5
-1
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user