Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zeitlinger committed Apr 26, 2024
1 parent 7c2ad1f commit e692181
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ group = "io.opentelemetry.instrumentation"
val versions: Map<String, String> by project
val springBootVersion = versions["org.springframework.boot"]

// R2DBC is shadowed to prevent org.springframework.boot.autoconfigure.r2dbc.R2dbcAutoConfiguration
// from being loaded by Spring Boot - even if the user doesn't want to use R2DBC.
sourceSets {
main {
val shadedDep = project(":instrumentation:r2dbc-1.0:library-instrumentation-shaded")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"resources": {
"includes": [
{
"pattern": "META-INF/io/opentelemetry/instrumentation/.*.properties"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,18 @@ private <T extends Consumer<TraceAssert>> void waitAndAssertTraces(
try {
await()
.untilAsserted(() -> doAssertTraces(traceComparator, assertionsList, verifyScopeVersion));
} catch (ConditionTimeoutException e) {
// Don't throw this failure since the stack is the awaitility thread, causing confusion.
// Instead, just assert one more time on the test thread, which will fail with a better stack
// trace.
// TODO(anuraaga): There is probably a better way to do this.
doAssertTraces(traceComparator, assertionsList, verifyScopeVersion);
} catch (Throwable t) {
// from org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:157)
// see https://github.com/oracle/graal/issues/6101 (spring boot graal native image)
if (t.getClass().getName().equals("com.oracle.svm.core.jdk.UnsupportedFeatureError") || t instanceof ConditionTimeoutException) {
// Don't throw this failure since the stack is the awaitility thread, causing confusion.
// Instead, just assert one more time on the test thread, which will fail with a better stack
// trace.
// TODO(anuraaga): There is probably a better way to do this.
doAssertTraces(traceComparator, assertionsList, verifyScopeVersion);
} else {
throw t;
}
}
}

Expand Down

0 comments on commit e692181

Please sign in to comment.