[CI][UT] Fix flaky unit test (#16151)

This commit is contained in:
xiangzihao 2024-06-14 10:47:29 +08:00 committed by GitHub
parent 8e53f2fdcb
commit 8d0202ccaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -22,6 +22,7 @@ import org.apache.commons.lang3.RandomUtils;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.time.Duration;
import java.util.stream.Stream;
import lombok.SneakyThrows;
@ -52,7 +53,7 @@ class MysqlJdbcRegistryTestCase extends JdbcRegistryTestCase {
.withDatabaseName("dolphinscheduler")
.withNetwork(Network.newNetwork())
.withExposedPorts(3306)
.waitingFor(Wait.forHealthcheck());
.waitingFor(Wait.forHealthcheck().withStartupTimeout(Duration.ofSeconds(300)));
int exposedPort = RandomUtils.nextInt(10000, 65535);
mysqlContainer.setPortBindings(Lists.newArrayList(exposedPort + ":3306"));