Skip to content

Commit 61b0645

Browse files
committed
优化测试
1 parent 487c24a commit 61b0645

File tree

1 file changed

+4
-2
lines changed
  • hsweb-easy-orm-rdb/src/test/java/org/hswebframework/ezorm/rdb

1 file changed

+4
-2
lines changed

hsweb-easy-orm-rdb/src/test/java/org/hswebframework/ezorm/rdb/Containers.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import org.testcontainers.containers.wait.strategy.Wait;
55
import org.testcontainers.utility.DockerImageName;
66

7+
import java.time.Duration;
8+
79
public class Containers {
810

911
public static GenericContainer<?> newMysql(String version) {
@@ -32,7 +34,7 @@ public static GenericContainer<?> newOracle() {
3234
return new GenericContainer<>(DockerImageName.parse("iatebes/oracle_11g"))
3335
.withEnv("TZ", "Asia/Shanghai")
3436
.withExposedPorts(1521)
35-
.waitingFor(Wait.forLogMessage(".*opened.*", 1));
37+
.waitingFor(Wait.forLogMessage(".*opened.*", 1).withStartupTimeout(Duration.ofMinutes(2)));
3638
}
3739

3840
public static GenericContainer<?> newMSSQL() {
@@ -42,7 +44,7 @@ public static GenericContainer<?> newMSSQL() {
4244
.withEnv("ACCEPT_EULA","y")
4345
.withEnv("MSSQL_PID","Enterprise")
4446
.withExposedPorts(1433)
45-
.waitingFor(Wait.forLogMessage(".*Service Broker manager has started.*",1));
47+
.waitingFor(Wait.forLogMessage(".*Service Broker manager has started.*",1).withStartupTimeout(Duration.ofMinutes(2)));
4648
}
4749

4850
}

0 commit comments

Comments
 (0)