Retry flaky couchbase 3.1 startup (#12873)
This commit is contained in:
parent
96eccaf008
commit
919661f9ff
|
@ -44,6 +44,18 @@ class CouchbaseClient31Test {
|
||||||
|
|
||||||
@BeforeAll
|
@BeforeAll
|
||||||
static void setup() {
|
static void setup() {
|
||||||
|
// wait and retry in the hope that it will help against test flakiness
|
||||||
|
await()
|
||||||
|
.atMost(Duration.ofMinutes(5))
|
||||||
|
.ignoreException(UnambiguousTimeoutException.class)
|
||||||
|
.until(
|
||||||
|
() -> {
|
||||||
|
startCouchbase();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void startCouchbase() {
|
||||||
couchbase =
|
couchbase =
|
||||||
new CouchbaseContainer("couchbase/server:7.6.0")
|
new CouchbaseContainer("couchbase/server:7.6.0")
|
||||||
.withExposedPorts(8091)
|
.withExposedPorts(8091)
|
||||||
|
@ -65,18 +77,11 @@ class CouchbaseClient31Test {
|
||||||
ClusterOptions.clusterOptions(couchbase.getUsername(), couchbase.getPassword())
|
ClusterOptions.clusterOptions(couchbase.getUsername(), couchbase.getPassword())
|
||||||
.environment(environment));
|
.environment(environment));
|
||||||
|
|
||||||
// wait and retry in the hope that it will help against test flakiness
|
|
||||||
await()
|
|
||||||
.atMost(Duration.ofMinutes(2))
|
|
||||||
.ignoreException(UnambiguousTimeoutException.class)
|
|
||||||
.until(
|
|
||||||
() -> {
|
|
||||||
Bucket bucket = cluster.bucket("test");
|
Bucket bucket = cluster.bucket("test");
|
||||||
collection = bucket.defaultCollection();
|
collection = bucket.defaultCollection();
|
||||||
|
|
||||||
bucket.waitUntilReady(Duration.ofSeconds(30));
|
// Wait 1 minute due to slow startup contributing to flakiness
|
||||||
return true;
|
bucket.waitUntilReady(Duration.ofMinutes(1));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterAll
|
@AfterAll
|
||||||
|
|
Loading…
Reference in New Issue