Browse Source

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

dev
xiangzihao 5 months ago committed by GitHub
parent
commit
8d0202ccaf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/test/java/org/apache/dolphinscheduler/plugin/registry/jdbc/MysqlJdbcRegistryTestCase.java

3
dolphinscheduler-registry/dolphinscheduler-registry-plugins/dolphinscheduler-registry-jdbc/src/test/java/org/apache/dolphinscheduler/plugin/registry/jdbc/MysqlJdbcRegistryTestCase.java

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

Loading…
Cancel
Save