Disable flaky test (#10360)

This commit is contained in:
Lauri Tulmin 2024-01-31 12:23:40 +02:00 committed by GitHub
parent f52a3b404a
commit 7bc2b7ba90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View File

@ -59,6 +59,8 @@ dependencies {
}
tasks.withType<Test>().configureEach {
systemProperty("testLatestDeps", findProperty("testLatestDeps") as Boolean)
// TODO run tests both with and without experimental span attributes
jvmArgs("-Dotel.instrumentation.elasticsearch.experimental-span-attributes=true")

View File

@ -7,8 +7,10 @@ package springdata
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.semconv.SemanticAttributes
import org.junit.jupiter.api.Assumptions
import org.springframework.context.annotation.AnnotationConfigApplicationContext
import spock.lang.Shared
import spock.util.environment.Jvm
import java.lang.reflect.InvocationHandler
import java.lang.reflect.Method
@ -48,7 +50,7 @@ class Elasticsearch53SpringRepositoryTest extends AgentInstrumentationSpecificat
}
void close() {
applicationContext.close()
applicationContext?.close()
}
@Override
@ -58,6 +60,9 @@ class Elasticsearch53SpringRepositoryTest extends AgentInstrumentationSpecificat
}
def setup() {
// when running on jdk 21 this test occasionally fails with timeout
Assumptions.assumeTrue(Boolean.getBoolean("testLatestDeps") || !Jvm.getCurrent().isJava21Compatible())
repo.refresh()
clearExportedData()
runWithSpan("delete") {