I have a contrived test case showcasing how multiple test cases can slow the entire execution time down, as even though each is quick on its own, they add up if waited for before executing the next.
I have created a repository for this:
<?php namespace Kopernikus\ParallelParatests\Tests; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\Attributes\DataProvider; class ItShouldTestInPallarel extends TestCase { #[DataProvider('delayProvider')] public function testItRunsTestsInParallel(int $delay) { sleep($delay); $this->assertTrue(true); } public static function delayProvider() { return array_map(function ($value) { return [$value]; }, array_fill(0, 10, 1)); } } In order speed up test execution time, I installed paratest:
composer require brianium/paratest --dev Now I expected the test to finish after 1 seconds.
I execute the test via phpstorm (and have enabled the paratest config), yet the entire test run still takes ~10s as each test is executed one after the other.
/bin/php /home/philipp/php/parallel-paratests/vendor/bin/paratest_for_phpstorm /home/philipp/php/parallel-paratests/vendor/phpunit/phpunit/phpunit --bootstrap /tmp/ide-phpstorm_bootstrap.php --filter Kopernikus\\ParallelParatests\\Tests\\ItShouldTestInPallarel --test-suffix ItShouldTestInPallarel.php /home/philipp/php/parallel-paratests/tests --teamcity Testing started at 5:48 PM ... PHPUnit 12.3.8 by Sebastian Bergmann and contributors. Runtime: PHP 8.4.12 Time: 00:10.034, Memory: 14.00 MB OK (10 tests, 10 assertions) Process finished with exit code 0 Reading further, I may require --functional flag for paratest, yet have no clue as of yet how to pass that within PhpStorm.
I managed to get parallel test execution on bash terminal, yet not within PhpStorm:
~ ./vendor/bin/paratest /home/philipp/php/parallel-paratests/tests/ItShouldTestInPallarel.php --functional ParaTest v7.12.0 upon PHPUnit 12.3.8 by Sebastian Bergmann and contributors. Processes: 32 Runtime: PHP 8.4.12 .......... 10 / 10 (100%) Time: 00:01.215, Memory: 12.00 MB OK (10 tests, 10 assertions) I have no idea how to pass the --functional flag in phpstorm to paratest:

/home/philipp/php/parallel-paratests/vendor/bin/paratest_for_phpstormchanging this:require PhpstormHelper::handleArgvFromPhpstorm($_SERVER['argv'], __DIR__ . '/paratest');with this:require PhpstormHelper::handleArgvFromPhpstorm($_SERVER['argv'], __DIR__ . '/paratest --functional');