Stop reusing the Cluster when waiting for Cassandra to start
See gh-10516
This commit is contained in:
parent
927003e0b7
commit
c7f5f0735d
|
|
@ -109,19 +109,20 @@ public class CassandraDataAutoConfigurationIntegrationTests {
|
|||
@Override
|
||||
protected void waitUntilReady() {
|
||||
super.waitUntilReady();
|
||||
Cluster cluster = Cluster.builder().addContactPoint("localhost").build();
|
||||
|
||||
try {
|
||||
Unreliables.retryUntilTrue((int) this.startupTimeout.getSeconds(),
|
||||
TimeUnit.SECONDS, checkConnection(cluster));
|
||||
TimeUnit.SECONDS, checkConnection());
|
||||
}
|
||||
catch (TimeoutException e) {
|
||||
throw new IllegalStateException();
|
||||
catch (TimeoutException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
private Callable<Boolean> checkConnection(Cluster cluster) {
|
||||
private Callable<Boolean> checkConnection() {
|
||||
return () -> {
|
||||
try {
|
||||
try (Cluster cluster = Cluster.builder().addContactPoint("localhost")
|
||||
.build()) {
|
||||
cluster.connect();
|
||||
return true;
|
||||
}
|
||||
|
|
@ -130,6 +131,7 @@ public class CassandraDataAutoConfigurationIntegrationTests {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue