Skip to content

ts-jest transform cache causes memory leak when using multiple processes in CI #442

@cangarugula

Description

@cangarugula

This issue is discussed here: kulshekhar/ts-jest#1967

When running tests with multiple processes (maxWorkers > 1), ts-jest caches transformed results multiple times, resulting in a memory leak issue. The failure occurs in a CI pipeline with these errors:

Screen Shot 2021-06-07 at 6 28 20 AM

Screen Shot 2021-06-07 at 6 27 10 AM

The tests that fail due to memory issues do not stay consistent when running with workers.

While these errors don't show locally, when logging heap usage, you can see that each test has an increased heap size. Here is a sample of heap size logs:

Screen Shot 2021-06-07 at 6 46 25 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions