You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let --maxWorkers accept a percent as value. If the remaining value is so small that it only matches less than 1 CPU, always make sure we leave at least 1 core free.
Motivation
We run Jest to test stuff that calls a lot of DB calls. When we keep the default and do not set --maxWorkers we often run into issues where test timeout. This happens because OS is very bad at switching CPU resources from Jest transpiling to database and it basically locks up even the beefiest of machines.
So we need to run jest with a slightly smaller number of --maxWorkers than the host system has available CPU threads. For example
when running on an OS with 12 CPUs we want to let jest have 10 cores.
On a system with 4 cpus, we want to let jest have 3 cpus and leave one of the DB.
On a system with 2 cpus, we want to let jest have 1 cpu and leave one of the DB.
Example
jest --maxWorkers=85%
Pitch
because it is convenient for me and there are other people running into similar issues like for example #8407
The text was updated successfully, but these errors were encountered:
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🚀 Feature Proposal
Let
--maxWorkers
accept a percent as value. If the remaining value is so small that it only matches less than 1 CPU, always make sure we leave at least 1 core free.Motivation
We run Jest to test stuff that calls a lot of DB calls. When we keep the default and do not set
--maxWorkers
we often run into issues where test timeout. This happens because OS is very bad at switching CPU resources from Jest transpiling to database and it basically locks up even the beefiest of machines.So we need to run jest with a slightly smaller number of
--maxWorkers
than the host system has available CPU threads. For examplewhen running on an OS with 12 CPUs we want to let jest have 10 cores.
On a system with 4 cpus, we want to let jest have 3 cpus and leave one of the DB.
On a system with 2 cpus, we want to let jest have 1 cpu and leave one of the DB.
Example
jest --maxWorkers=85%
Pitch
because it is convenient for me and there are other people running into similar issues like for example #8407
The text was updated successfully, but these errors were encountered: