Skip to content

Commit a51c894

Browse files
authored
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 d6c0b81 commit a51c894

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

doc/api/test.md

Lines changed: 9 additions & 3 deletions
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.
@@ -1776,7 +1782,7 @@ changes:
17761782
* `options` {Object} Configuration options for the subtest. The following
17771783
properties are supported:
17781784
* `concurrency` {number|boolean|null} If a number is provided,
1779-
then that many tests would run in parallel.
1785+
then that many tests would run in parallel within the application thread.
17801786
If `true`, it would run all subtests in parallel.
17811787
If `false`, it would only run one test at a time.
17821788
If unspecified, subtests inherit this value from their parent.

0 commit comments

Comments
 (0)