diff options
author | Tobias Nießen <tniessen@tnie.de> | 2023-04-28 20:32:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-28 18:32:08 +0000 |
commit | 1baf96aeb88680bb89b1903b97a574b13e1674ab (patch) | |
tree | 2db01e38d33bf97db0dee4894dbd9681954ec513 /doc | |
parent | b31d587dc8c1b0f459243d2b96a17a7175c996cf (diff) | |
download | node-new-1baf96aeb88680bb89b1903b97a574b13e1674ab.tar.gz |
doc,test: fix concurrency option of test()
The documentation appears to still be wrong w.r.t. the meaning of the
concurrency option of the test() function. The implementation appears to
default to Infinity when the option is set to true. Is that intended or
a good idea? I don't know. It certainly makes more sense than what the
documentation says (which is basing the number of concurrent tasks
within a single thread on the number of CPU cores).
This changes the documentation to hopefully match the implementation and
adds a test that rules out the (rather arbitrary) behavior described in
the documentation.
Refs: https://github.com/nodejs/node/issues/47365
Refs: https://github.com/nodejs/node/pull/47642
PR-URL: https://github.com/nodejs/node/pull/47734
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/test.md | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/doc/api/test.md b/doc/api/test.md index 61658b886c..f6be4f7932 100644 --- a/doc/api/test.md +++ b/doc/api/test.md @@ -808,9 +808,8 @@ changes: properties are supported: * `concurrency` {number|boolean} If a number is provided, then that many tests would run in parallel within the application thread. - If `true`, it would run `os.availableParallelism() - 1` tests in parallel. - For subtests, it will be `Infinity` tests in parallel. - If `false`, it would only run one test at a time. + If `true`, all scheduled asynchronous tests run concurrently within the + thread. If `false`, only one test runs at a time. If unspecified, subtests inherit this value from their parent. **Default:** `false`. * `only` {boolean} If truthy, and the test context is configured to run |