There was a problem with phpunit on symfony due to their parallel execution.
More precisely, when executing setUp, execution drops with a message about too many database connections (PDOException: SQLSTATE [HY000] [1040] Too many connections)
How to run a bunch of unrelated (not depends) tests in one thread?
Googling has not helped yet.

  • > There was a problem with the tests due to their parallel execution. The first sign that they are a bit wrong> How to run a bunch of unrelated (not depends) tests in one thread? most likely should be found in the tests annotations @runInSeparateProcess and remove them - etki
  • I did not specify this annotation in the tests. - zenith
  • @zenith, hmm, but why did you decide that they run in parallel with you? - etki
  • @Etki I asked a question. I assumed that this is the only reason for the occurrence of such an error (Too many connections). If I'm wrong, tell me where to dig? - zenith
  • @zenith, by default they are one stream (the process, more precisely, php does not yet have support for out-of-the-box streams), they seem to be executed. Check the connections on the database engine, check that the connections are closed, lay out a specific piece of code. - etki

1 answer 1

The problem was that the connection did not close automatically.

$ entityManager-> getConnection () -> close ();

Found the answer here