Skip to content

πŸ”§ Raise test/test:unit heap ceiling (jest ESM OOM on large suites)Β #3948

Description

@PierreBrisorgueil

What β€” add --max-old-space-size=8192 to the test and test:unit npm scripts so large unit-test suites stop crashing with a V8 heap-allocation failure.

Scope β€” jest with --experimental-vm-modules leaks ESM module registries between suites (upstream jest issue, still present on jest 30): measured ~15 MB leaked per suite under --runInBand, linear growth. Node's default old-space ceiling (~4 GB) is hit around ~280 suites β€” a downstream consumer with a large suite already hit it (OOM, not a test failure; the full suite passes clean at 8192). The :coverage variants already carry their own --max-old-space-size flags and are untouched.

The flag is a ceiling, not a reservation β€” no cost for small suites. If a suite ever approaches 8 GB, worker recycling (workerIdleMemoryLimit, dropping --runInBand) becomes the structural fix.

Created via /dev:issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions