pulse: Running test with mysql database throws too many connections or memory issue
Pulse Version
latest
Laravel Version
10.32
PHP Version
8.1.9
Livewire Version
dont know
Database Driver & Version
MySQL 8.0.31 for macOS 14.0 on arm64 (Docker)
Description
Hello,
When I run tests using the MySQL database with --parallel, even with Redis, the tests stop in the middle, giving me the error message: “Too many connections.”
[1040] Too many connections (Connection: mysql, SQL: drop database if exists `project_testing_test_2`))
If i run without --parallel, it’s giving me the memory limit exception
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/vendor/laravel/framework/src/Illuminate/Collections/Arr.php on line 565
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in /var/www/vendor/laravel/framework/src/Illuminate/Collections/Arr.php on line 565
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /var/www/vendor/pestphp/pest/src/Plugins/Actions/CallsShutdown.php on line 1
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in /var/www/vendor/pestphp/pest/src/Plugins/Actions/CallsShutdown.php on line 1
Am I doing something wrong?
Steps To Reproduce
Configure tests to use mysql
- php artisan test --parallel (too many connections)
- php artisan test (throws memory exception)
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Reactions: 2
- Comments: 44 (21 by maintainers)
Disable Pulse in your tests. You can add
PULSE_ENABLED=falsein yourphpunit.xmlfile.@Andilutten we will tag a release next week that should allow you to update. Will keep ya posted.
@taghwo, Pulse now requires a minimum framework version of
10.34. If your application has not yet updated to10.34or greater you will not be able to install the latest beta.I recommend updating at least to
10.37.3to address the memory leak issue reported.I’m glad to hear the memory issue was resolved.
Will try these out over the weekend and get back on Monday.
v1.0.0-beta8has been tagged which should introduce these fixes.Hello @timacdonald
I’ve done a
composer updatebut the package was not updated. Triedcomposer remove laravel/pulseandcomposer require laravel/pulsetooWhat i`m doing wrong?
Thanks
Hi, I have same issue here, tested with v1.0.0-beta5 and v1.0.0-beta7
There are 800 tests in my project, test are running on mysql, phpunit.xml file with PULSE_ENABLED as false. No redis. After 400 tests I get this error:
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 266240 bytes) in … each time in different file
Hello.
I’ve already done that and the problem still persists