If I run my tests using PHP7.2 or PHP7.1, they are about 3 times slower than if I ran them using PHP7.0. In any case, to understand why this is happening?
Even when I run the test suites (Feature and Unit) separately, I still see a slowdown. This is only when I run the tests individually, the difference in speed becomes insignificant.
I am using Laravel 5.5.20 and Laravel Homestead 7.0.1. I have 47 fairly simple tests, some get into the database, others are just simple statements; therefore there is nothing that could take age.
I installed johnkary / phpunit-speedtrap to find out which tests take the most, so I could remove them, but there is no specific test that takes a long time because if I remove the offensive test, the next one will last (see below )
First Run Second Run Test A 0.2 sec Test A 0.2 sec Test B. 0.3 sec Test B. 0.3 sec Test C 0.1 sec Test C 0.1 sec Test D 0.1 sec Test D 0.1 sec Test E 9.3 sec REMOVED Test E Test F 0.3 sec Test F 9.3 sec <-- Test F now takes ages Test G 0.2 sec Test G 0.2 sec
I also use an in-memory SQLite3 database with the Laravel CreatesApplication and RefreshDatabase since I want each test to run independently.
I do not have Xdebug installed or running. Is there anything known that PHP7.1 and PHP7.2 take a long time to run PHPUnit tests? Is there anything else I can install (or even run with Xdebug) to find out what exactly is causing the problem?
Customization
Laravel 5.5.20 Laravel Homestead 7.0.1 (Per-project installation) PHPUnit 6.4.4 Vagrant 2.0.1 Virtualbox 5.2.4
results
PHP 7.2 PHPUnit 6.4.4 Time: 12.4 seconds, Memory: 162.00MB PHP 7.1 PHPUnit 6.4.4 Time: 12.19 seconds, Memory: 162.00MB PHP 7.0 PHPUnit 6.4.4 Time: 4.88 seconds, Memory: 162.00MB
source share