Skip to content

Commit

Permalink
improved compatibility with temporal dev server
Browse files Browse the repository at this point in the history
  • Loading branch information
cappuc committed May 15, 2024
1 parent 1327277 commit 51439a7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
14 changes: 11 additions & 3 deletions src/Testing/LocalTemporalServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,17 @@ protected function startServer(string $binaryPath, ?int $port): void

$this->temporalServerProcess->start();

$serverStarted = $this->temporalServerProcess->waitUntil(
fn ($type, $output) => Str::contains((string) $output, 'http server started')
);
try {
$serverStarted = $this->temporalServerProcess->waitUntil(
fn ($type, $output) => Str::contains((string) $output, [
'http server started',
'Temporal server is running',
'Temporal server:',
])
);
} catch (\Throwable) {
$serverStarted = false;
}

if (! $serverStarted) {
$this->debugOutput('<error>error</error>');
Expand Down
10 changes: 7 additions & 3 deletions src/Testing/TemporalTestingWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,13 @@ protected function startTemporalWorker(): void

$this->roadRunnerProcess->start();

$roadRunnerStarted = $this->roadRunnerProcess->waitUntil(
fn ($type, $output) => Str::contains((string) $output, 'RoadRunner server started')
);
try {
$roadRunnerStarted = $this->roadRunnerProcess->waitUntil(
fn ($type, $output) => Str::contains((string) $output, 'RoadRunner server started')
);
} catch (\Throwable) {
$roadRunnerStarted = false;
}

if (! $roadRunnerStarted) {
$this->debugOutput('<error>error</error>');
Expand Down

0 comments on commit 51439a7

Please sign in to comment.