mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Protect autoconfigure module against slow starting test containers
This commit is contained in:
parent
7f62c5a283
commit
29080b87ec
@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.autoconfigure.data.cassandra;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import com.datastax.driver.core.Cluster;
|
||||
import com.datastax.driver.core.Session;
|
||||
import org.junit.After;
|
||||
@ -45,7 +47,7 @@ public class CassandraDataAutoConfigurationIntegrationTests {
|
||||
|
||||
@ClassRule
|
||||
public static SkippableContainer<CassandraContainer<?>> cassandra = new SkippableContainer<>(
|
||||
CassandraContainer::new);
|
||||
() -> new CassandraContainer<>().withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(2)));
|
||||
|
||||
private AnnotationConfigApplicationContext context;
|
||||
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.boot.testsupport.testcontainers;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
|
||||
/**
|
||||
@ -28,7 +30,8 @@ import org.testcontainers.containers.GenericContainer;
|
||||
public class RedisContainer extends Container {
|
||||
|
||||
public RedisContainer() {
|
||||
super("redis:4.0.6", 6379);
|
||||
super("redis:4.0.6", 6379,
|
||||
(container) -> container.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(2)));
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user