Protect tests against Cassandra startup failures

On CI, Cassandra running inside the Docker container sometimes fails
to start or the start times out. This has nothing to do with Boot so
we  attempt to protect our tests from the flakiness of the container
by allowing 3 startup attempts.
pull/11759/merge
Andy Wilkinson 7 years ago
parent 292025936e
commit 1a1a62b744

@ -37,8 +37,8 @@ public class CassandraContainer extends Container {
private static final int PORT = 9042; private static final int PORT = 9042;
public CassandraContainer() { public CassandraContainer() {
super("cassandra:3.11.1", PORT, super("cassandra:3.11.1", PORT, (container) -> container
(container) -> container.waitingFor(new WaitStrategy())); .waitingFor(new WaitStrategy()).withStartupAttempts(3));
} }
private static class WaitStrategy extends HostPortWaitStrategy { private static class WaitStrategy extends HostPortWaitStrategy {

Loading…
Cancel
Save