Skip to content

Commit 27ac47b

Browse files
authored
Fix jfr-events tests (#2818)
1 parent bd36eea commit 27ac47b

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

jfr-events/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tasks {
2323

2424
// Disabled due to https://bugs.openjdk.java.net/browse/JDK-8245283
2525
configure<JacocoTaskExtension> {
26-
enabled = false
26+
isEnabled = false
2727
}
2828
}
2929
}

jfr-events/src/test/java/io/opentelemetry/contrib/jfrevent/JfrSpanProcessorTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ void basicSpan() throws IOException {
7272
assertThat(events).hasSize(1);
7373
assertThat(events)
7474
.extracting(e -> e.getValue("traceId"))
75-
.isEqualTo(span.getSpanContext().getTraceId());
75+
.containsExactly(span.getSpanContext().getTraceId());
7676
assertThat(events)
7777
.extracting(e -> e.getValue("spanId"))
78-
.isEqualTo(span.getSpanContext().getSpanId());
79-
assertThat(events).extracting(e -> e.getValue("operationName")).isEqualTo(OPERATION_NAME);
78+
.containsExactly(span.getSpanContext().getSpanId());
79+
assertThat(events)
80+
.extracting(e -> e.getValue("operationName"))
81+
.containsExactly(OPERATION_NAME);
8082
} finally {
8183
Files.delete(output);
8284
}
@@ -111,14 +113,14 @@ void basicSpanWithScope() throws IOException, InterruptedException {
111113
assertThat(events).hasSize(2);
112114
assertThat(events)
113115
.extracting(e -> e.getValue("traceId"))
114-
.isEqualTo(span.getSpanContext().getTraceId());
116+
.containsOnly(span.getSpanContext().getTraceId());
115117
assertThat(events)
116118
.extracting(e -> e.getValue("spanId"))
117-
.isEqualTo(span.getSpanContext().getSpanId());
119+
.containsOnly(span.getSpanContext().getSpanId());
118120
assertThat(events)
119121
.filteredOn(e -> "Span".equals(e.getEventType().getLabel()))
120122
.extracting(e -> e.getValue("operationName"))
121-
.isEqualTo(OPERATION_NAME);
123+
.containsExactly(OPERATION_NAME);
122124

123125
} finally {
124126
Files.delete(output);

0 commit comments

Comments
 (0)