Skip to content

Commit ba13d84

Browse files
committed
test_runner: fix it concurrency
1 parent a933a75 commit ba13d84

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/internal/test_runner/test.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
'use strict';
22
const {
33
ArrayPrototypePush,
4-
ArrayPrototypeReduce,
54
ArrayPrototypeShift,
65
ArrayPrototypeUnshift,
76
FunctionPrototype,
87
Number,
9-
PromiseResolve,
108
ReflectApply,
119
SafeMap,
10+
SafePromiseAll,
1211
} = primordials;
1312
const { AsyncResource } = require('async_hooks');
1413
const {
@@ -470,10 +469,7 @@ class Suite extends Test {
470469
this.parent.activeSubtests++;
471470
this.startTime = hrtime();
472471
const subtests = this.skipped ? [] : this.subtests;
473-
await ArrayPrototypeReduce(subtests, async (prev, subtest) => {
474-
await prev;
475-
await subtest.run();
476-
}, PromiseResolve());
472+
await SafePromiseAll(subtests, (subtests) => subtests.start());
477473
this.pass();
478474
this.postRun();
479475
}

0 commit comments

Comments
 (0)