Skip to content

Commit 7bc2b7b

Browse files
authored
Disable flaky test (#10360)
1 parent f52a3b4 commit 7bc2b7b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/build.gradle.kts

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ dependencies {
5959
}
6060

6161
tasks.withType<Test>().configureEach {
62+
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
63+
6264
// TODO run tests both with and without experimental span attributes
6365
jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true")
6466

instrumentation/elasticsearch/elasticsearch-transport-5.3/javaagent/src/test/groovy/springdata/Elasticsearch53SpringRepositoryTest.groovy

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ package springdata
77

88
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
99
import io.opentelemetry.semconv.SemanticAttributes
10+
import org.junit.jupiter.api.Assumptions
1011
import org.springframework.context.annotation.AnnotationConfigApplicationContext
1112
import spock.lang.Shared
13+
import spock.util.environment.Jvm
1214

1315
import java.lang.reflect.InvocationHandler
1416
import java.lang.reflect.Method
@@ -48,7 +50,7 @@ class Elasticsearch53SpringRepositoryTest extends AgentInstrumentationSpecificat
4850
}
4951

5052
void close() {
51-
applicationContext.close()
53+
applicationContext?.close()
5254
}
5355

5456
@Override
@@ -58,6 +60,9 @@ class Elasticsearch53SpringRepositoryTest extends AgentInstrumentationSpecificat
5860
}
5961

6062
def setup() {
63+
// when running on jdk 21 this test occasionally fails with timeout
64+
Assumptions.assumeTrue(Boolean.getBoolean("testLatestDeps") || !Jvm.getCurrent().isJava21Compatible())
65+
6166
repo.refresh()
6267
clearExportedData()
6368
runWithSpan("delete") {

0 commit comments

Comments
 (0)