Skip to content

Commit a1403a8

Browse files
tniessentargos
authored andcommitted
doc: clarify concurrency model of test runner
Refs: #47365 PR-URL: #47642 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent a793cf4 commit a1403a8

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
@@ -379,6 +379,11 @@ Otherwise, the test is considered to be a failure. Test files must be
379379
executable by Node.js, but are not required to use the `node:test` module
380380
internally.
381381

382+
Each test file is executed as if it was a regular script. That is, if the test
383+
file itself uses `node:test` to define tests, all of those tests will be
384+
executed within a single application thread, regardless of the value of the
385+
`concurrency` option of [`test()`][].
386+
382387
## Collecting code coverage
383388

384389
> Stability: 1 - Experimental
@@ -735,7 +740,8 @@ changes:
735740
* `options` {Object} Configuration options for running tests. The following
736741
properties are supported:
737742
* `concurrency` {number|boolean} If a number is provided,
738-
then that many files would run in parallel.
743+
then that many test processes would run in parallel, where each process
744+
corresponds to one test file.
739745
If `true`, it would run `os.availableParallelism() - 1` test files in
740746
parallel.
741747
If `false`, it would only run one test file at a time.
@@ -805,7 +811,7 @@ changes:
805811
* `options` {Object} Configuration options for the test. The following
806812
properties are supported:
807813
* `concurrency` {number|boolean} If a number is provided,
808-
then that many tests would run in parallel.
814+
then that many tests would run in parallel within the application thread.
809815
If `true`, it would run `os.availableParallelism() - 1` tests in parallel.
810816
For subtests, it will be `Infinity` tests in parallel.
811817
If `false`, it would only run one test at a time.
@@ -1774,7 +1780,7 @@ changes:
17741780
* `options` {Object} Configuration options for the subtest. The following
17751781
properties are supported:
17761782
* `concurrency` {number|boolean|null} If a number is provided,
1777-
then that many tests would run in parallel.
1783+
then that many tests would run in parallel within the application thread.
17781784
If `true`, it would run all subtests in parallel.
17791785
If `false`, it would only run one test at a time.
17801786
If unspecified, subtests inherit this value from their parent.

0 commit comments

Comments
 (0)