There is a Laravel app with a test suite that runs completely in about 3 minutes.
Somewhere around 2 minutes the test freezes for ~60094ms. Every time it is a different test so it does not seem to be related to any specific test.
None of the tests are failing, they're just experiencing this weird delay. What could be causing 60 seconds delay in PhpUnit?
You should really fix these slow tests (>200ms)...
1. 60094ms to run Tests\Feature\Superadmin\BusinessActivityTest:testDestroyBusinessActivityProductionProcess
2. 3357ms to run Tests\Feature\AccessTokenTest:testOauthToken
3. 1124ms to run Tests\Feature\Superadmin\ArticleTest:testUpdateArticleForAdmin
4. 969ms to run Tests\Feature\VtaDocumentTest:testUploadVehiclesFileHappyPathWithFilePDF
5. 737ms to run Tests\Feature\VtaDocumentTest:testUploadCertificateFilePDF
...and there are 22 more above your threshold hidden from view
Time: 2.46 minutes, Memory: 144.25MB
OS phpunit version phpunit -v PHPUnit 7.3.0 by Sebastian Bergmann and contributors. Runtime: PHP 7.3.5-1+ubuntu18.04.1+deb.sury.org+1 with Xdebug 2.7.1
Issue is also there with vendor/bin/phpunit --version PHPUnit 7.5.2 by Sebastian Bergmann and contributors.
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<env name="APP_ENV" value="testing"/>
<env name="DB_DATABASE" value="testing"/>
<env name="BCRYPT_ROUNDS" value="4"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<env name="MAIL_DRIVER" value="array"/>
</php>
<listeners>
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener">
<arguments>
<array>
<element key="slowThreshold">
<integer>200</integer>
</element>
<element key="reportLength">
<integer>5</integer>
</element>
</array>
</arguments>
</listener>
</listeners>
</phpunit>