[Bug]: Jest in a container over-estimates available resources
Version
29.7.0
Steps to reproduce
Run Jest in a container.
Expected behavior
Jest will establish available resources in the container and configure itself appropriately e.g.
"maxConcurrency": 5,
"maxWorkers": 1,
Actual behavior
Jest appears to allocate resource based on the host machine specs e.g.
"maxConcurrency": 5,
"maxWorkers": 31,
Which results in the container being OoM killed.
Additional context
No response
Environment
The container spec is:
resources:
requests:
memory: "8Gi"
cpu: "2"
ephemeral-storage: "20Gi"
limits:
memory: "8Gi"
cpu: "2"
ephemeral-storage: "20Gi"
However envinfo reports:
System:
OS: Linux 5.15 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (32) x64 AMD EPYC 7763 64-Core Processor
Binaries:
Node: 20.19.1 - ~/_work/_tool/node/20.19.1/x64/bin/node
npm: 10.8.2 - ~/_work/_tool/node/20.19.1/x64/bin/npm
npmPackages:
jest: ^29.7.0 => 29.7.0
My understanding is that Node's os.availableParallelism is supposed to solve this, which is what Jest uses as of v29.4.0 (https://github.com/jestjs/jest/pull/13738). But maybe there's something else going on?
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
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.