Skip to content

Commit 278adfb

Browse files
committed
Restore grpc library exclusion in javaagent test classpath
PR open-telemetry#18316 removed the test classpath filter that excluded the grpc library instrumentation jar from testExperimental, testStableSemconv, and testBothSemconv. The removed comment explicitly warned that the bundled ContextStorageOverride breaks these tests, and indeed it does: with the library on the classpath, the gRPC Context (including its cancellation) propagates through application executors, causing clientCallAfterServerCompleted to fail with 'CANCELLED: io.grpc.Context was cancelled without error'. This was the root cause of recent testLatestDeps3 job failures on main.
1 parent d780054 commit 278adfb

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

instrumentation/grpc-1.6/javaagent/build.gradle.kts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ tasks {
5353
testClassesDirs = sourceSets.test.get().output.classesDirs
5454
classpath = sourceSets.test.get().runtimeClasspath
5555

56+
// exclude our grpc library instrumentation, the ContextStorageOverride contained within it
57+
// breaks the tests
58+
classpath = classpath.filter {
59+
!it.absolutePath.contains("opentelemetry-grpc-1.6")
60+
}
61+
5662
systemProperty("metadataConfig", "otel.instrumentation.grpc.experimental-span-attributes=true")
5763
jvmArgs("-Dotel.instrumentation.grpc.experimental-span-attributes=true")
5864
}
@@ -61,6 +67,12 @@ tasks {
6167
testClassesDirs = sourceSets.test.get().output.classesDirs
6268
classpath = sourceSets.test.get().runtimeClasspath
6369

70+
// exclude our grpc library instrumentation, the ContextStorageOverride contained within it
71+
// breaks the tests
72+
classpath = classpath.filter {
73+
!it.absolutePath.contains("opentelemetry-grpc-1.6")
74+
}
75+
6476
jvmArgs("-Dotel.semconv-stability.opt-in=rpc")
6577
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=rpc")
6678
}
@@ -69,6 +81,12 @@ tasks {
6981
testClassesDirs = sourceSets.test.get().output.classesDirs
7082
classpath = sourceSets.test.get().runtimeClasspath
7183

84+
// exclude our grpc library instrumentation, the ContextStorageOverride contained within it
85+
// breaks the tests
86+
classpath = classpath.filter {
87+
!it.absolutePath.contains("opentelemetry-grpc-1.6")
88+
}
89+
7290
jvmArgs("-Dotel.semconv-stability.opt-in=rpc/dup")
7391
systemProperty("metadataConfig", "otel.semconv-stability.opt-in=rpc/dup")
7492
}

0 commit comments

Comments
 (0)