Skip to content

Commit 4f541c3

Browse files
tniessenMoLow
authored andcommittedJul 6, 2023
doc: clarify concurrency model of test runner
Refs: #47365 PR-URL: #47642 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7cef6aa commit 4f541c3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed
 

‎doc/api/test.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,11 @@ Otherwise, the test is considered to be a failure. Test files must be
373373
executable by Node.js, but are not required to use the `node:test` module
374374
internally.
375375

376+
Each test file is executed as if it was a regular script. That is, if the test
377+
file itself uses `node:test` to define tests, all of those tests will be
378+
executed within a single application thread, regardless of the value of the
379+
`concurrency` option of [`test()`][].
380+
376381
## Collecting code coverage
377382

378383
When Node.js is started with the [`--experimental-test-coverage`][]
@@ -718,7 +723,8 @@ changes:
718723
* `options` {Object} Configuration options for running tests. The following
719724
properties are supported:
720725
* `concurrency` {number|boolean} If a number is provided,
721-
then that many files would run in parallel.
726+
then that many test processes would run in parallel, where each process
727+
corresponds to one test file.
722728
If `true`, it would run `os.availableParallelism() - 1` test files in
723729
parallel.
724730
If `false`, it would only run one test file at a time.
@@ -782,7 +788,7 @@ changes:
782788
* `options` {Object} Configuration options for the test. The following
783789
properties are supported:
784790
* `concurrency` {number|boolean} If a number is provided,
785-
then that many tests would run in parallel.
791+
then that many tests would run in parallel within the application thread.
786792
If `true`, it would run `os.availableParallelism() - 1` tests in parallel.
787793
For subtests, it will be `Infinity` tests in parallel.
788794
If `false`, it would only run one test at a time.
@@ -1683,7 +1689,7 @@ changes:
16831689
* `options` {Object} Configuration options for the subtest. The following
16841690
properties are supported:
16851691
* `concurrency` {number|boolean|null} If a number is provided,
1686-
then that many tests would run in parallel.
1692+
then that many tests would run in parallel within the application thread.
16871693
If `true`, it would run all subtests in parallel.
16881694
If `false`, it would only run one test at a time.
16891695
If unspecified, subtests inherit this value from their parent.

0 commit comments

Comments
 (0)