Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions testing/src/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
$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,
Expand Down Expand Up @@ -217,9 +217,11 @@
]);
exit(1);
}

$rrCommand ??= [$this->systemInfo->rrExecutable, 'serve', '-c', $configFile]

$this->roadRunnerProcess = new Process(

Check failure on line 223 in testing/src/Environment.php

View workflow job for this annotation

GitHub Actions / Psalm Validation (PHP 8.3, OS ubuntu-latest)

ParseError

testing/src/Environment.php:223:9: ParseError: Syntax error, unexpected T_VARIABLE on line 223 (see https://psalm.dev/173)
command: $rrCommand ?? [$this->systemInfo->rrExecutable, 'serve'],
command: $rrCommand,
env: $envs,
);
$this->roadRunnerProcess->setTimeout($commandTimeout);
Expand All @@ -231,16 +233,16 @@

// 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(),
Expand Down
Loading