diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 4237d3f41ba..9bec57d2607 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -436,6 +436,21 @@ jobs: cd e2e/bug-14036 composer install ../../bin/phpstan analyze + - script: | + cd e2e/vvv-with-debug + OUTPUT=$(../../bin/phpstan analyze -l 0 -vvv --debug test.php 2>&1) + echo "$OUTPUT" + ../bashunit -a not_contains 'Parallel processing scheduler' "$OUTPUT" + - script: | + cd e2e/vvv-with-debug + OUTPUT=$(../../bin/phpstan analyze -l 0 -vvv --debug --configuration parallel.neon test.php 2>&1) + echo "$OUTPUT" + ../bashunit -a not_contains 'Parallel processing scheduler' "$OUTPUT" + - script: | + cd e2e/vvv-with-debug + OUTPUT=$(../../bin/phpstan analyze -l 0 -vvv test.php 2>&1) + echo "$OUTPUT" + ../bashunit -a contains 'Parallel processing scheduler' "$OUTPUT" steps: - name: Harden the runner (Audit all outbound calls) diff --git a/e2e/vvv-with-debug/parallel.neon b/e2e/vvv-with-debug/parallel.neon new file mode 100644 index 00000000000..39a1d6edcd7 --- /dev/null +++ b/e2e/vvv-with-debug/parallel.neon @@ -0,0 +1,3 @@ +parameters: + parallel: + maximumNumberOfProcesses: 2 diff --git a/e2e/vvv-with-debug/test.php b/e2e/vvv-with-debug/test.php new file mode 100644 index 00000000000..b3d9bbc7f37 --- /dev/null +++ b/e2e/vvv-with-debug/test.php @@ -0,0 +1 @@ +scheduler->scheduleWork($this->cpuCoreCounter->getNumberOfCpuCores(), $files); - $mainScript = null; - if (isset($_SERVER['argv'][0]) && is_file($_SERVER['argv'][0])) { - $mainScript = $_SERVER['argv'][0]; - } + if (!$debug && $allowParallel && function_exists('proc_open')) { + $schedule = $this->scheduler->scheduleWork($this->cpuCoreCounter->getNumberOfCpuCores(), $files); + + $mainScript = null; + if (isset($_SERVER['argv'][0]) && is_file($_SERVER['argv'][0])) { + $mainScript = $_SERVER['argv'][0]; + } - if ( - !$debug - && $allowParallel - && function_exists('proc_open') - && $mainScript !== null - && $schedule->getNumberOfProcesses() > 0 - ) { - $loop = new StreamSelectLoop(); - $result = null; - $promise = $this->parallelAnalyser->analyse($loop, $schedule, $mainScript, $postFileCallback, $projectConfigFile, $tmpFile, $insteadOfFile, $input, null); - $promise->then(static function (AnalyserResult $tmp) use (&$result): void { - $result = $tmp; - }); - $loop->run(); - if ($result === null) { - throw new ShouldNotHappenException(); + if ($mainScript !== null && $schedule->getNumberOfProcesses() > 0) { + $loop = new StreamSelectLoop(); + $result = null; + $promise = $this->parallelAnalyser->analyse($loop, $schedule, $mainScript, $postFileCallback, $projectConfigFile, $tmpFile, $insteadOfFile, $input, null); + $promise->then(static function (AnalyserResult $tmp) use (&$result): void { + $result = $tmp; + }); + $loop->run(); + if ($result === null) { + throw new ShouldNotHappenException(); + } + return $result; } - return $result; } return $this->analyser->analyse(