-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test_runner: introduce NODE_TEST_WORKER_ID for improved concurrent te… #56091
base: main
Are you sure you want to change the base?
Conversation
…st execution Added a new environment variable, `NODE_TEST_WORKER_ID`, which ranges from 1 to N when `--experimental-test-isolation=process` is enabled and defaults to 1 when `--experimental-test-isolation=none` is used.
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @cu8code, thanks for the PR.
I'm requesting changes since we're still missing tests.
Regarding the implementation, LGTM.
Another important thing: to make this new feature available to users, we also need to update the documentation with this behavior 🚀
Regarding the tests, I think you'll want to use |
I'm concerned this has too much cross-over with If there is a good reason behind making If there is not a particular rationale for the non-sequentiality of The problem described in the cited issue is well handled via If we're merely trying to facilitate migration, I think we should first consider that point and whether there is a way to ease that migration without redundancy. Without seeing the OP's code, I can only imagine what it looks like, but I suspect perhaps less than 20% would need to be adjusted. Likely the biggest hindrance is knowledge, which can be provided (ex a Learn article). |
ref: #55842
Added a new environment variable,
NODE_TEST_WORKER_ID
, which ranges from 1 to N when--experimental-test-isolation=process
is enabled and defaults to 1 when--experimental-test-isolation=none
is used.Before merging, I want to add some tests but haven't come up with a good approach yet. Here's what I aim to test:
--experimental-test-isolation=process
is enabled, verify thatNODE_TEST_WORKER_ID
ranges from 1 to N.--experimental-test-isolation=none
is used, ensure thatNODE_TEST_WORKER_ID
is set to 1.Any suggestions on how to create such tests would be greatly appreciated!