Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 919661f

Browse files
authoredDec 10, 2024··
Retry flaky couchbase 3.1 startup (#12873)
1 parent 96eccaf commit 919661f

File tree

1 file changed

+16
-11
lines changed
  • instrumentation/couchbase/couchbase-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1

1 file changed

+16
-11
lines changed
 

‎instrumentation/couchbase/couchbase-3.1/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/couchbase/v3_1/CouchbaseClient31Test.java

+16-11
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@ class CouchbaseClient31Test {
4444

4545
@BeforeAll
4646
static void setup() {
47+
// wait and retry in the hope that it will help against test flakiness
48+
await()
49+
.atMost(Duration.ofMinutes(5))
50+
.ignoreException(UnambiguousTimeoutException.class)
51+
.until(
52+
() -> {
53+
startCouchbase();
54+
return true;
55+
});
56+
}
57+
58+
private static void startCouchbase() {
4759
couchbase =
4860
new CouchbaseContainer("couchbase/server:7.6.0")
4961
.withExposedPorts(8091)
@@ -65,18 +77,11 @@ static void setup() {
6577
ClusterOptions.clusterOptions(couchbase.getUsername(), couchbase.getPassword())
6678
.environment(environment));
6779

68-
// wait and retry in the hope that it will help against test flakiness
69-
await()
70-
.atMost(Duration.ofMinutes(2))
71-
.ignoreException(UnambiguousTimeoutException.class)
72-
.until(
73-
() -> {
74-
Bucket bucket = cluster.bucket("test");
75-
collection = bucket.defaultCollection();
80+
Bucket bucket = cluster.bucket("test");
81+
collection = bucket.defaultCollection();
7682

77-
bucket.waitUntilReady(Duration.ofSeconds(30));
78-
return true;
79-
});
83+
// Wait 1 minute due to slow startup contributing to flakiness
84+
bucket.waitUntilReady(Duration.ofMinutes(1));
8085
}
8186

8287
@AfterAll

0 commit comments

Comments
 (0)
Please sign in to comment.