Fixes in WaitForHealthCheck params and legacy tests

This commit is contained in:
Sergei Shitikov
2024-09-29 18:48:46 +02:00
parent 90edcd48f4
commit 49031990a2
3 changed files with 25 additions and 9 deletions
+13 -6
View File
@@ -123,12 +123,19 @@ class GenericContainer implements TestContainer
return $this;
}
public function withHealthCheckCommand(string $command, int $healthCheckIntervalInMS = 1000): static
{
$this->healthConfig = new HealthConfig([
'Test' => ['CMD', $command],
'Interval' => $healthCheckIntervalInMS,
]);
public function withHealthCheckCommand(
string $command,
int $intervalInMilliseconds = 1000,
int $timeoutInMilliseconds = 3000,
int $retries = 3,
int $startPeriodInMilliseconds = 0
): static {
$this->healthConfig = new HealthConfig();
$this->healthConfig->setTest(['CMD-SHELL', $command]);
$this->healthConfig->setInterval($intervalInMilliseconds * 1_000_000);
$this->healthConfig->setTimeout($timeoutInMilliseconds * 1_000_000);
$this->healthConfig->setRetries($retries);
$this->healthConfig->setStartPeriod($startPeriodInMilliseconds * 1_000_000);
return $this;
}