|
11 | 11 | import datadog.trace.api.Config; |
12 | 12 | import datadog.trace.api.metrics.BaggageMetrics; |
13 | 13 | import datadog.trace.api.telemetry.CoreMetricCollector; |
14 | | -import datadog.trace.test.util.Flaky; |
15 | 14 | import java.util.Collection; |
16 | 15 | import java.util.Collections; |
17 | 16 | import java.util.List; |
18 | 17 | import java.util.Map; |
19 | 18 | import java.util.stream.Collectors; |
| 19 | +import org.junit.jupiter.api.BeforeEach; |
20 | 20 | import org.junit.jupiter.api.Test; |
21 | 21 |
|
22 | 22 | class BaggagePropagatorTelemetryTest { |
23 | 23 |
|
24 | 24 | private static final CarrierVisitor<Map<String, String>> MAP_VISITOR = Map::forEach; |
25 | 25 |
|
| 26 | + @BeforeEach |
| 27 | + void setup() { |
| 28 | + // Drain any metrics accumulated by other tests |
| 29 | + CoreMetricCollector.getInstance().prepareMetrics(); |
| 30 | + CoreMetricCollector.getInstance().drain(); |
| 31 | + } |
| 32 | + |
26 | 33 | @Test |
27 | 34 | void shouldDirectlyIncrementBaggageMetrics() { |
28 | 35 | BaggageMetrics baggageMetrics = BaggageMetrics.getInstance(); |
@@ -68,7 +75,6 @@ void shouldIncrementTelemetryCounterWhenBaggageIsSuccessfullyExtracted() { |
68 | 75 | assertTrue(baggageMetric.tags.contains("header_style:baggage")); |
69 | 76 | } |
70 | 77 |
|
71 | | - @Flaky |
72 | 78 | @Test |
73 | 79 | void shouldDirectlyIncrementAllBaggageMetrics() { |
74 | 80 | BaggageMetrics baggageMetrics = BaggageMetrics.getInstance(); |
@@ -122,7 +128,6 @@ void shouldDirectlyIncrementAllBaggageMetrics() { |
122 | 128 | assertEquals(1, itemsTruncatedMetric.value.longValue()); |
123 | 129 | } |
124 | 130 |
|
125 | | - @Flaky |
126 | 131 | @Test |
127 | 132 | void shouldNotIncrementTelemetryCounterWhenBaggageExtractionFails() { |
128 | 133 | Config config = mock(Config.class); |
|
0 commit comments