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.
This commit is contained in:
Andy Wilkinson
2018-01-24 21:34:11 +00:00
parent 292025936e
commit 1a1a62b744

View File

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