Commit 29080b87 authored by Andy Wilkinson's avatar Andy Wilkinson

Protect autoconfigure module against slow starting test containers

parent 7f62c5a2
......@@ -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)));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment