-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
feat: forceWorkers param to force workers to be used when they otherwise wouldn't be #13168
Conversation
docs/CLI.md
Outdated
@@ -275,7 +281,7 @@ Lists all test files that Jest will run given the arguments, and exits. | |||
|
|||
### `--logHeapUsage` | |||
|
|||
Logs the heap usage after every test. Useful to debug memory leaks. Use together with `--runInBand` and `--expose-gc` in node. | |||
Logs the heap usage after every test. Useful to debug memory leaks. Can be used together with `--runInBand` and `--expose-gc` in node to diagnose memory leaks, etc. |
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.
Perhaps 'or'? Reading comment from the user it sounded like 'and' was the misleading part. At least this is how my eye is reading this 'and'.
Also would be good to make this change in version docs as well. They live in website/versioned_docs
Logs the heap usage after every test. Useful to debug memory leaks. Can be used together with `--runInBand` and `--expose-gc` in node to diagnose memory leaks, etc. | |
Logs the heap usage after every test. Useful to debug memory leaks. Can be used together with flags like `--runInBand` or `--expose-gc` to diagnose memory leaks, etc. |
@nover this should do what you need |
Co-authored-by: Tom Mrazauskas <tom@mrazauskas.de>
Co-authored-by: Tom Mrazauskas <tom@mrazauskas.de>
Sorted. |
Thanks. These were just tiny details. You should add a Changelog entry as well (; |
Out of curiosity. Why did you go for a new flag instead of tweaking |
Primarily because |
I see. There are other limitations most probably. Just an idea, what if having Also it might make sense to throw (or at least to print a warning), if |
That is a fair point, the memory limit will be totally useless without workers and there's nothing at runtime to indicate that's the case. I'm happy to do a second PR to make that change and then I guess you can pick your preferred route. Based on that it would be |
While I was digging around the code I also had a thought that the way we pass around the number of workers isn't ideal. We pass 1 as an indicator of runInBand, be logically 0 should be runInBand, IE no workers please. 1 should be a valid number of actual workers to use. |
@phawxby With the risk of sounding greedy: when do you expect to have this available in an installable alpha? :) |
@nover I'll see if I can find some time to implement @mrazauskas suggestion above later today and then I'll let them decide which approach they want to take |
@SimenB @mrazauskas pick your poison, #13168 or #13171, both do roughly the same thing in different ways |
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
#11956 (comment)
Fairly sure I've done a better job at testing the functionality behaves as expected via e2e tests.