diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 596535597ae..bb2ed371407 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -2436,6 +2436,16 @@ jobs: exit 1 fi + # another program that loads PHPStan restarts through + # TurboProcessRestarter, and can leave OPcache dormant: the same + # single restart disarms pcov, and no process turns OPcache on + - operating-system: "ubuntu-latest" + coverage: "pcov" + extensions: "" + script: | + php restart-without-opcache.php analyse --no-progress + php check.php restarted-for=pcov pcov-armed=no opcache-cli-on=no processes=2+ starts=2 + # --debug restarts like any other run - it only makes the analysis # serial, --xdebug is what keeps xdebug - operating-system: "ubuntu-latest" diff --git a/e2e/restart-manager/restart-without-opcache.php b/e2e/restart-manager/restart-without-opcache.php new file mode 100644 index 00000000000..6e1368fa625 --- /dev/null +++ b/e2e/restart-manager/restart-without-opcache.php @@ -0,0 +1,22 @@ +_ALLOW_XDEBUG is set - the variable composer/xdebug-handler * reads for that application, so a caller can drop its own xdebug restart. * + * With $withOpcache false, the restart does not turn on OPcache. A run + * that mostly reads the result cache is then faster, and a full analysis + * uses a little more CPU. + * * @api * @param list $argv */ - public static function restartIfSuitable(array $argv, ?string $pharPath = null, ?string $appName = null): void + public static function restartIfSuitable(array $argv, ?string $pharPath = null, ?string $appName = null, bool $withOpcache = true): void { + if (!$withOpcache) { + $extensions = $appName === null + ? [ + 'phpstan_turbo', + 'tideways', + ] + : [ + 'xdebug', + 'pcov', + 'uopz', + 'phpstan_turbo', + 'tideways', + ]; + RestartManager::run($argv, $pharPath, $extensions, $appName ?? 'phpstan'); + return; + } + if ($appName === null) { RestartManager::run($argv, $pharPath, ['phpstan_turbo', 'tideways', 'opcache']); return;