Skip to content

Add a memory limit for test runner processesΒ #6147

Description

@lo1tuma

We hit a problem where one mutant made a test allocate memory without stopping. It went from 2 GB to over 60 GB in about ten seconds. That was enough to run our whole CI machine out of memory. The Linux OOM killer then killed the GitHub Actions runner agent, so the job failed with "The runner has received a shutdown signal" and nothing pointed at Stryker or at the test. It took us a long time to find.

Stryker already protects against a mutant that runs too long, viatimeoutMS and timeoutFactor. There is no equivalent for a mutant that allocates too much. In our case the two were racing: the timeout was about 10 seconds, and filling the machine took 8 to 12 seconds. Whichever won decided if the run survived. That is why it looked flaky.

Would you consider a memory limit for test runner children? Something like testRunnerMemoryLimitMB. If a worker passes it, kill the worker and mark the mutant the same way a timeout is marked.

Things we tried that did not work:

  • --max-old-space-size via testRunnerNodeArgs. The memory was not in the V8 old space, so the cap had no effect. We tested 512 MB and the process still reached 60 GB.
  • Lowering concurrency. The runaway just used the memory that freeing up workers gave it. With concurrency: 1 it still died.

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