-
-
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
--maxWorkers only allows numbers and no % of cores #8559
Comments
%
%
It should be a string. Can you send a PR fixing this? :) |
Ok will do :-) |
I looked into that. I think in principle we would actually need to make it a string e.g. I traced this variable around a bit and it seems as if there are multiple definitions depending on where this is coming from and I am not sure if we can savely change this to a |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
Giving
--maxWorkers
a%
instead of a fixed core number does not seem to work.I looked into it, I found that it seems to expect a number and parsing it sets it to
NaN
in
jest-cli
it checks the args only for a numberhttps://github.com/facebook/jest/blob/master/packages/jest-cli/src/cli/args.ts#L345
I quickly tried setting it to a string and it works as expected. I am not sure of all the ramifications of this change but it might be the correct type for it.
To Reproduce
run jest with
--maxWorkers=20%
and it will default to 50%Expected behavior
It should use only 20% of my cpus
Run
npx envinfo --preset jest
The text was updated successfully, but these errors were encountered: