From f39cea04280e2cc506353e6c68aac62f7e406017 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 24 Apr 2018 10:25:58 +0100 Subject: [PATCH] Try to stabilize build by giving Cassandra longer to start --- .../testsupport/testcontainers/CassandraContainer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/CassandraContainer.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/CassandraContainer.java index 8ec58a8de2..e607ac9b57 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/CassandraContainer.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/testcontainers/CassandraContainer.java @@ -16,6 +16,7 @@ package org.springframework.boot.testsupport.testcontainers; +import java.time.Duration; import java.util.concurrent.Callable; import java.util.concurrent.TimeUnit; @@ -37,10 +38,9 @@ public class CassandraContainer extends Container { private static final int PORT = 9042; public CassandraContainer() { - super("cassandra:3.11.1", PORT, - (container) -> container - .waitingFor(new WaitStrategy(container.getMappedPort(PORT))) - .withStartupAttempts(3)); + super("cassandra:3.11.1", PORT, (container) -> container + .waitingFor(new WaitStrategy(container.getMappedPort(PORT))) + .withStartupAttempts(3).withStartupTimeout(Duration.ofSeconds(60))); } private static class WaitStrategy extends HostPortWaitStrategy {