From d36d76a407f14b71e4ece63e49ec508c8d905efb Mon Sep 17 00:00:00 2001 From: Massimiliano Torromeo Date: Wed, 25 Mar 2026 11:36:02 +0100 Subject: [PATCH 1/2] fix: give up early starting the testing roadrunner command if the process terminates --- testing/src/Environment.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/src/Environment.php b/testing/src/Environment.php index cd65655c..a48373d0 100644 --- a/testing/src/Environment.php +++ b/testing/src/Environment.php @@ -126,7 +126,7 @@ public function startTemporalServer( $this->temporalServerProcess->start(); $deadline = \microtime(true) + (float) $commandTimeout; - while (!$temporalStarted && \microtime(true) < $deadline) { + while ($this->temporalServerProcess->isRunning() && !$temporalStarted && \microtime(true) < $deadline) { \usleep(10_000); $check = new Process([ $this->systemInfo->temporalCliExecutable, @@ -217,16 +217,16 @@ public function startRoadRunner(?array $rrCommand = null, int $commandTimeout = // wait for roadrunner to start $deadline = \microtime(true) + (float) $commandTimeout; - while (!$roadRunnerStarted && \microtime(true) < $deadline) { + while ($this->roadRunnerProcess->isRunning() && !$roadRunnerStarted && \microtime(true) < $deadline) { \usleep(10_000); - $check = new Process([$this->systemInfo->rrExecutable, 'workers', '-c', $configFile]); + $check = new Process(array_map(static fn ($arg) => $arg === 'serve' ? 'workers' : $arg, $rrCommand)); $check->run(); if (\str_contains($check->getOutput(), 'Workers of')) { $roadRunnerStarted = true; } } - if (!$roadRunnerStarted) { + if (!$roadRunnerStarted || !$this->roadRunnerProcess->isRunning()) { $this->io->error(\sprintf( 'Failed to start until RoadRunner is ready. Status: "%s". Stderr: "%s". Stdout: "%s".', $this->roadRunnerProcess->getStatus(), From 54ebcb78ee2ec757c15445c20cf3cb55ea565c84 Mon Sep 17 00:00:00 2001 From: Massimiliano Torromeo Date: Wed, 25 Mar 2026 11:37:01 +0100 Subject: [PATCH 2/2] fix: do not ignore the $configFile parameter of the testing environment --- testing/src/Environment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/src/Environment.php b/testing/src/Environment.php index a48373d0..f8eb5f3b 100644 --- a/testing/src/Environment.php +++ b/testing/src/Environment.php @@ -205,7 +205,7 @@ public function startRoadRunner(?array $rrCommand = null, int $commandTimeout = } $this->roadRunnerProcess = new Process( - command: $rrCommand ?? [$this->systemInfo->rrExecutable, 'serve'], + command: $rrCommand ?? [$this->systemInfo->rrExecutable, 'serve', '-c', $configFile], env: $envs, ); $this->roadRunnerProcess->setTimeout($commandTimeout);