Skip to content
Permalink
Browse files
test_runner: fix it concurrency
PR-URL: #43757
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jacob Smith <jacob@frende.me>
  • Loading branch information
MoLow authored and danielleadams committed Jul 26, 2022
1 parent 2910136 commit f13e4c1be9139af455fe9f5ca7a7473bf60f5071
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
@@ -1,15 +1,14 @@
'use strict';
const {
ArrayPrototypePush,
ArrayPrototypeReduce,
ArrayPrototypeShift,
ArrayPrototypeUnshift,
FunctionPrototype,
Number,
PromiseResolve,
ReflectApply,
SafeMap,
PromiseRace,
SafePromiseAll,
} = primordials;
const { AsyncResource } = require('async_hooks');
const {
@@ -506,10 +505,7 @@ class Suite extends Test {
this.parent.activeSubtests++;
this.startTime = hrtime();
const subtests = this.skipped || this.error ? [] : this.subtests;
await testTimeout(ArrayPrototypeReduce(subtests, async (prev, subtest) => {
await prev;
await subtest.run();
}, PromiseResolve()), this.timeout);
await SafePromiseAll(subtests, (subtests) => subtests.start());
this.pass();
this.postRun();
}
@@ -188,6 +188,10 @@ ok 20 - immediate resolve pass
*
*
*
*
*
*
*
...
1..1
not ok 21 - subtest sync throw fail
@@ -471,6 +475,9 @@ not ok 53 - custom inspect symbol that throws fail
*
*
*
*
*
*
...
# Subtest: sync throw fails at second
not ok 2 - sync throw fails at second
@@ -486,6 +493,10 @@ not ok 53 - custom inspect symbol that throws fail
*
*
*
*
*
*
*
...
1..2
not ok 54 - subtest sync throw fails
@@ -559,6 +570,8 @@ not ok 56 - describe async throw fails
failureType: 'testTimeoutFailure'
error: 'test timed out after 5ms'
code: 'ERR_TEST_FAILURE'
stack: |-
*
...
# Subtest: timed out callback test
not ok 2 - timed out callback test

0 comments on commit f13e4c1

Please sign in to comment.