Daniel-Marynicz / BehatParallelExtension

Behat Parallel Extension
MIT License
18 stars 6 forks source link

Fatal error: Allowed memory size of 2097152 bytes exhausted #55

Closed miiimooo closed 3 years ago

miiimooo commented 3 years ago

After enabling this in my behat tests and running with -l 2 (or any other parallel setting) all tests exit with:


Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 147456 bytes) in /app/vendor/psy/psysh/src/functions.php on line 81

behat version is v3.6.1 psy/psysh version is v0.10.4

Daniel-Marynicz commented 3 years ago

You should try increasing the memory_limit in php. Or set this to -1.

Daniel-Marynicz commented 3 years ago

And your 2 Megabytes memory limit is to low

Daniel-Marynicz commented 3 years ago

Probably you have the php.ini with

 memory_limit = ${PHP_MEMORY_LIMIT}

And in your test process environment variable does not exists. And php sets memory_limit to low 2 MB.

you can set in the behat.yaml something like

default:
    # ...
    extensions:
        DMarynicz\BehatParallelExtension\Extension:
          environments:
            -
              PHP_MEMORY_LIMIT: '2GB'
            -
              PHP_MEMORY_LIMIT: '2GB'
miiimooo commented 3 years ago

Thanks @Daniel-Marynicz - in my setup it still seems to ignore the environment variable but I just set the value in the php.ini now (I'm using a container based setup managed by lando)