Skip to content

Commit b4b4267

Browse files
committed
Assert trace only once
1 parent 68dbcd5 commit b4b4267

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

testing-common/src/main/java/io/opentelemetry/instrumentation/testing/InstrumentationTestRunner.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import java.util.stream.Collectors;
3030
import javax.annotation.Nullable;
3131
import org.assertj.core.api.ListAssert;
32-
import org.awaitility.core.ConditionTimeoutException;
3332

3433
/**
3534
* This interface defines a common set of operations for interaction with OpenTelemetry SDK and
@@ -118,25 +117,7 @@ private <T extends Consumer<TraceAssert>> void waitAndAssertTraces(
118117
List<T> assertionsList = new ArrayList<>();
119118
assertions.forEach(assertionsList::add);
120119

121-
try {
122-
await()
123-
.untilAsserted(() -> doAssertTraces(traceComparator, assertionsList, verifyScopeVersion));
124-
} catch (Throwable t) {
125-
// awaitility is doing a jmx call that is not implemented in GraalVM:
126-
// call:
127-
// https://github.com/awaitility/awaitility/blob/fbe16add874b4260dd240108304d5c0be84eabc8/awaitility/src/main/java/org/awaitility/core/ConditionAwaiter.java#L157
128-
// see https://github.com/oracle/graal/issues/6101 (spring boot graal native image)
129-
if (t.getClass().getName().equals("com.oracle.svm.core.jdk.UnsupportedFeatureError")
130-
|| t instanceof ConditionTimeoutException) {
131-
// Don't throw this failure since the stack is the awaitility thread, causing confusion.
132-
// Instead, just assert one more time on the test thread, which will fail with a better
133-
// stack trace.
134-
// TODO(anuraaga): There is probably a better way to do this.
135-
doAssertTraces(traceComparator, assertionsList, verifyScopeVersion);
136-
} else {
137-
throw t;
138-
}
139-
}
120+
doAssertTraces(traceComparator, assertionsList, verifyScopeVersion);
140121
}
141122

142123
private <T extends Consumer<TraceAssert>> void doAssertTraces(

0 commit comments

Comments
 (0)