Elektrine lite

← Feed

@ilia@phpc.social

Post #4247245

2026-07-30 17:19 UTC

A few times now had a run-away testsuite consume all memory, in part due to the fact on CLI, php runs without a memory limit by default. @sebastian@phpc.social Any thoughts about adding default limit (even a large on 1G) to phpunit by default?

Replies (1)

  • @sebastian@phpc.social 2026-07-30 18:08

    @ilia@phpc.social I do not think PHPUnit should do anything here. Whatever limit is appropriate is a project- and environment-specific decision: suites that collect code coverage or run large integration tests legitimately need more memory than any default PHPUnit could pick, and getting it wrong means a fatal error that kills the whole run. PHPUnit runs arbitrary project code, so it's the least qualified party to choose that number.

    Open ##4248485