Skip to content

Commit 0d77587

Browse files
authored
Fix flaky test (#1623)
1 parent b600c74 commit 0d77587

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

consistent-sampling/src/test/java/io/opentelemetry/contrib/sampler/consistent/ConsistentReservoirSamplingSpanProcessorTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,11 @@ void exportSpansToMultipleServices() {
243243

244244
@Test
245245
void ignoresNullSpans() {
246+
SpanExporter mockSpanExporter = mock(SpanExporter.class);
247+
when(mockSpanExporter.shutdown()).thenReturn(CompletableResultCode.ofSuccess());
246248
SpanProcessor processor =
247249
ConsistentReservoirSamplingSpanProcessor.create(
248-
mock(SpanExporter.class), RESERVOIR_SIZE, EXPORT_PERIOD_100_MILLIS_AS_NANOS);
250+
mockSpanExporter, RESERVOIR_SIZE, EXPORT_PERIOD_100_MILLIS_AS_NANOS);
249251
assertThatCode(
250252
() -> {
251253
processor.onStart(null, null);

0 commit comments

Comments
 (0)