Implement WaitForExec using new Client library. Add BaseWait to avoid some code duplication. Adjust Postgres test

This commit is contained in:
Sergei Shitikov
2024-09-01 18:23:21 +02:00
parent 3dd4d2525a
commit ea07a96091
6 changed files with 94 additions and 45 deletions
+4 -7
View File
@@ -5,23 +5,20 @@ declare(strict_types=1);
namespace Testcontainers\Wait;
use Docker\API\Runtime\Client\Client;
use Docker\Docker;
use Testcontainers\Exception\ContainerWaitingTimeoutException;
/**
* Uses $timout and $pollInterval in milliseconds to set the parameters for waiting.
*/
class WaitForLog implements WaitInterface
class WaitForLog extends BaseWait
{
protected Docker $dockerClient;
public function __construct(
protected string $message,
protected bool $enableRegex = false,
protected int $timeout = 10000,
protected int $pollInterval = 500
int $timeout = 10000,
int $pollInterval = 500
) {
$this->dockerClient = Docker::create();
parent::__construct($timeout, $pollInterval);
}
public function wait(string $id): void