Skip to content

[Bug]: Jest in a container over-estimates available resources #15595

@robert-smith-maersk

Description

@robert-smith-maersk

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions