From b4dd0a260149e0799112c226fc7bccc6cec0368d Mon Sep 17 00:00:00 2001 From: Alexey Kuznetsov Date: Mon, 13 Apr 2026 13:36:13 -0400 Subject: [PATCH] Marked test as flaky. Fixed warnings highlighted by IDEA. --- .../baggage/BaggagePropagatorTelemetryTest.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dd-trace-core/src/test/java/datadog/trace/core/baggage/BaggagePropagatorTelemetryTest.java b/dd-trace-core/src/test/java/datadog/trace/core/baggage/BaggagePropagatorTelemetryTest.java index b94393b773c..0b2b1943e06 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/baggage/BaggagePropagatorTelemetryTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/baggage/BaggagePropagatorTelemetryTest.java @@ -1,5 +1,6 @@ package datadog.trace.core.baggage; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; @@ -20,8 +21,7 @@ class BaggagePropagatorTelemetryTest { - private static final CarrierVisitor> MAP_VISITOR = - (map, consumer) -> map.forEach(consumer); + private static final CarrierVisitor> MAP_VISITOR = Map::forEach; @Test void shouldDirectlyIncrementBaggageMetrics() { @@ -68,6 +68,7 @@ void shouldIncrementTelemetryCounterWhenBaggageIsSuccessfullyExtracted() { assertTrue(baggageMetric.tags.contains("header_style:baggage")); } + @Flaky @Test void shouldDirectlyIncrementAllBaggageMetrics() { BaggageMetrics baggageMetrics = BaggageMetrics.getInstance(); @@ -86,7 +87,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() { .findFirst() .orElse(null); assertNotNull(injectedMetric); - assertTrue(injectedMetric.value.longValue() == 1); + assertEquals(1, injectedMetric.value.longValue()); assertTrue(injectedMetric.tags.contains("header_style:baggage")); CoreMetricCollector.CoreMetric malformedMetric = @@ -95,7 +96,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() { .findFirst() .orElse(null); assertNotNull(malformedMetric); - assertTrue(malformedMetric.value.longValue() == 1); + assertEquals(1, malformedMetric.value.longValue()); assertTrue(malformedMetric.tags.contains("header_style:baggage")); CoreMetricCollector.CoreMetric bytesTruncatedMetric = @@ -107,7 +108,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() { .findFirst() .orElse(null); assertNotNull(bytesTruncatedMetric); - assertTrue(bytesTruncatedMetric.value.longValue() == 1); + assertEquals(1, bytesTruncatedMetric.value.longValue()); CoreMetricCollector.CoreMetric itemsTruncatedMetric = metrics.stream() @@ -118,7 +119,7 @@ void shouldDirectlyIncrementAllBaggageMetrics() { .findFirst() .orElse(null); assertNotNull(itemsTruncatedMetric); - assertTrue(itemsTruncatedMetric.value.longValue() == 1); + assertEquals(1, itemsTruncatedMetric.value.longValue()); } @Flaky