@@ -171,20 +171,23 @@ void shouldTrackPercentilesWhenDynatraceSummaryInstrumentsNotUsed() throws Throw
171
171
DistributionSummary distributionSummary = DistributionSummary .builder ("my.ds" )
172
172
.publishPercentiles (trackedPercentiles )
173
173
.register (registry );
174
- CountDownLatch lttCountDownLatch = new CountDownLatch (1 );
175
174
LongTaskTimer longTaskTimer = LongTaskTimer .builder ("my.ltt" )
176
175
.publishPercentiles (trackedPercentiles )
177
176
.register (registry );
178
177
179
178
timer .record (Duration .ofMillis (100 ));
180
179
distributionSummary .record (100 );
181
180
181
+ CountDownLatch lttCountDownLatch1 = new CountDownLatch (1 );
182
+ CountDownLatch lttCountDownLatch2 = new CountDownLatch (1 );
183
+
182
184
ExecutorService executorService = Executors .newSingleThreadExecutor ();
183
185
executorService .submit (() -> longTaskTimer .record (() -> {
184
186
clock .add (Duration .ofMillis (100 ));
187
+ lttCountDownLatch1 .countDown ();
185
188
186
189
try {
187
- assertThat (lttCountDownLatch .await (300 , MILLISECONDS )).isTrue ();
190
+ assertThat (lttCountDownLatch2 .await (300 , MILLISECONDS )).isTrue ();
188
191
}
189
192
catch (InterruptedException e ) {
190
193
throw new RuntimeException (e );
@@ -193,9 +196,10 @@ void shouldTrackPercentilesWhenDynatraceSummaryInstrumentsNotUsed() throws Throw
193
196
194
197
clock .add (dynatraceConfig .step ());
195
198
199
+ assertThat (lttCountDownLatch1 .await (100 , MILLISECONDS )).isTrue ();
196
200
registry .publish ();
197
201
// release long task timer
198
- lttCountDownLatch .countDown ();
202
+ lttCountDownLatch2 .countDown ();
199
203
200
204
verify (httpClient ).send (
201
205
assertArg ((request -> assertThat (request .getEntity ()).asString ()
0 commit comments