Codeception icon indicating copy to clipboard operation
Codeception copied to clipboard

Test runner sometimes just stops, sometimes gives "Allowed memory size exhausted" error

Open ThomasLandauer opened this issue 1 year ago • 3 comments

Since my latest run (~2 weeks ago), the Codeception runner is suddenly hanging strangely:

  • Sometimes, in the middle of the suite, it just stops with message "COMMAND DID NOT FINISH PROPERLY."

  • Sometimes (at another test), it crashes with:

    PHP Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 20480 bytes) in ...vendor/symfony/var-dumper/Caster/ClassStub.php on line 52

    However, the memory_limit in my php.inis (for CLI and FPM) is 3000M. So where is the 1G limit coming from?

This is not caused by the tests themselves, cause when I run just the affected files alone, everything's fine.

Any ideas? Is somebody else experiencing this? Were there recent changes regarding memory management (couldn't find anything)?

ThomasLandauer avatar Apr 02 '25 18:04 ThomasLandauer

PHP 8.3.19

I have the same problem after upgrading to version 5.2.1

FATAL ERROR. TESTS NOT FINISHED. Allowed memory size of 1073741824 bytes exhausted (tried to allocate 1003520 bytes) An Error occurred while handling another error: Headers already sent in /var/www/vendor/codeception/codeception/src/Codeception/Subscriber/ErrorHandler.php on line 175

s1lver avatar Apr 14 '25 07:04 s1lver

Memory consumed(same tests):

Codeception v5.1.2 - 770.34 MB Codeception v5.2.1 - 1.30 GB Codeception v5.3.0 - 1.27 GB

s1lver avatar Apr 14 '25 12:04 s1lver

If you provide a sample application where this behavior can be replicated I could go commit by commit backwards and find out what change causes it.

In 5.2.0 and 5.2.1 a lot of changes were integrated.

TavoNiievez avatar Jun 23 '25 16:06 TavoNiievez