Adjust tests for OpenSearch

This commit is contained in:
Sergei Shitikov
2024-09-01 19:12:46 +02:00
parent ea07a96091
commit 93c9895027
5 changed files with 10 additions and 5 deletions
+1 -2
View File
@@ -12,9 +12,8 @@ class MySQLContainer extends GenericContainer
{
parent::__construct('mysql:' . $version);
$this->withExposedPorts(3306);
$this->withWait(new WaitForLog('ready for connections'));
$this->withEnvironment('MYSQL_ROOT_PASSWORD', $mysqlRootPassword);
$this->withWait(new WaitForLog('ready for connections'));
}
/**
+6 -1
View File
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Testcontainers\Container;
use Testcontainers\Wait\WaitForHttp;
use Testcontainers\Wait\WaitForLog;
class OpenSearchContainer extends GenericContainer
{
@@ -14,7 +15,11 @@ class OpenSearchContainer extends GenericContainer
$this->withExposedPorts(9200);
$this->withEnvironment('discovery.type', 'single-node');
$this->withEnvironment('OPENSEARCH_INITIAL_ADMIN_PASSWORD', 'c3o_ZPHo!');
$this->withWait(WaitForHttp::make(9200));
$this->withWait(new WaitForLog(
'/\]\s+started\?\[/',
true,
30000
));
}
/**