Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify concurrency model of test runner #47642

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

tniessen
Copy link
Member

This is based on my understanding of how it works, but I didn't actually test this or compare it with the implementation, so please review carefully @nodejs/test_runner.

Refs: #47365

@tniessen tniessen requested a review from MoLow April 20, 2023 13:47
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. dont-land-on-v14.x test_runner labels Apr 20, 2023
Copy link
Member

@MoLow MoLow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@tniessen tniessen added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 20, 2023
@@ -795,7 +801,7 @@ changes:
* `options` {Object} Configuration options for the test. The following
properties are supported:
* `concurrency` {number|boolean} If a number is provided,
then that many tests would run in parallel.
then that many tests would run in parallel within the application thread.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this adds clarity?

Suggested change
then that many tests would run in parallel within the application thread.
then that many tests would run in parallel within the current thread, similar to a set of promises awaited by `Promise.allSettled`.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think using current vs application does a great job at clarifying things. Why do you think it's important to call out Promise.allSettled vs anything else? I don't think it's helpful, it might even be a bit confusing given that the code doesn't use Promise.allSettled.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m trying to get across that it’s “in parallel” only in the sense that there are several async resources running within the current thread and process, as opposed to “true” parallelism from using multiple threads/processes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think #47642 (review) is a better suggestion, I agree that "parallel" is simply not a great word to describe what happens here, but let's take that discussion to another PR/issue.

Copy link
Member

@benjamingr benjamingr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change the word "parallel" when it's used to "concurrently" when it applies to running in the same js thread and use "parallel" exclusively to refer to cases where multiple workers are used.

@aduh95 aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 24, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 24, 2023
@nodejs-github-bot nodejs-github-bot merged commit a51c894 into nodejs:main Apr 24, 2023
30 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in a51c894

tniessen added a commit to tniessen/node that referenced this pull request Apr 26, 2023
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: nodejs#47365
Refs: nodejs#47642
yjl9903 pushed a commit to yjl9903/node that referenced this pull request Apr 28, 2023
Refs: nodejs#47365
PR-URL: nodejs#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>
yjl9903 pushed a commit to yjl9903/node that referenced this pull request Apr 28, 2023
Refs: nodejs#47365
PR-URL: nodejs#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>
nodejs-github-bot pushed a commit that referenced this pull request Apr 28, 2023
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: #47365
Refs: #47642
PR-URL: #47734
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
yjl9903 pushed a commit to yjl9903/node that referenced this pull request Apr 29, 2023
Refs: nodejs#47365
PR-URL: nodejs#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>
yjl9903 pushed a commit to yjl9903/node that referenced this pull request Apr 29, 2023
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: nodejs#47365
Refs: nodejs#47642
PR-URL: nodejs#47734
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
targos pushed a commit that referenced this pull request May 2, 2023
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>
targos pushed a commit that referenced this pull request May 2, 2023
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: #47365
Refs: #47642
PR-URL: #47734
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@targos targos mentioned this pull request May 2, 2023
targos pushed a commit that referenced this pull request May 3, 2023
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: #47365
Refs: #47642
PR-URL: #47734
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
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>
danielleadams pushed a commit that referenced this pull request Jul 6, 2023
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: #47365
Refs: #47642
PR-URL: #47734
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
MoLow pushed a commit to MoLow/node that referenced this pull request Jul 6, 2023
Refs: nodejs#47365
PR-URL: nodejs#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>
MoLow pushed a commit to MoLow/node that referenced this pull request Jul 6, 2023
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: nodejs#47365
Refs: nodejs#47642
PR-URL: nodejs#47734
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. test_runner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants