-
-
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
Use at least one worker by default (fixes #7181) #7182
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
Can we also fix this in |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
Thinking about |
Absolutely. This code probably comes from some time ago where the maximum amount of workers could not be configured. |
@thymikee I don't have all the context but I'd say we don't use the value in the config there because that call is to generate the haste map, whose workers are mainly used to synchronously read files from disk, which isn't CPU intensive anyway. Edit: @mjesun I just saw your answer. Do you think what I said could have something to do with it? |
Even if Haste processes are not CPU consuming, they still consume some CPU and they might force the kernel to switch to them; so it's legit to say that they should be bound too. What's however right is that if we say the limit is 8, we'll end up with 8 processes for haste + 8 processes for executing tests, which is not very nice... Either way, limiting it (even if you end up with 2x processes) is way better than just letting it go wild. |
We wouldn't be having 16 processes because haste processes execute and finish before test execution. So it's 8 + 8 serially, which is fine. |
I agree everything should use the same configuration for workers. We just need to make sure we still properly run things in band when specified. |
Yeah, using This also needs a changelog entry 🙂 |
Will this mean we'll use a single worker for runInBand (so it would fix #5731)? |
No (I think?). This is related to having a minimum >0, and normalizing the behavior. |
Thanks @biomedia-thomas! |
Oops, I merged too soon. I'm add the changelog entry myself 😅 |
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. |
Fixes #7181 use at least 1 CPU worker instead of 0 by default when number of CPUs is 1.