phpunit restarting tests randomly phpunit restarting tests randomly symfony symfony

phpunit restarting tests randomly


I'd suggest to check the database servers connection limits and pools.

For example if you've got a max limit of 100 connections, and some of the tests leaves connections open ("leaks"), you'd hit the limits there.

That would also explain why sometimes it works and sometimes it hits the limit, as your database could handle other tasks simultaneously, so sometimes you hit the ceiling, other times when nothing else runs, you can successfully run your tests.

Check for persistent network connections and other external resources.