I tried also use 'options' => [ PDO::ATTR_PERSISTENT => true ]
in database config. I had 1 connection but also had error PDOException: There is already an active transaction
Too many connection errors are your DB server refusing not your code.
Two ways I would combat this change the configuration on your DB server to allow more connections or go through all the tests and see that they are properly closing the connection to the database once it has finished running so that the next test can set up its own. Not having your code properly close your connection after your script runs can lead to you exhausting your DB Servers resources and potentially cause a Denial Of Service issue.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community