apupier commented on code in PR #24442:
URL: https://github.com/apache/camel/pull/24442#discussion_r3527434534


##########
core/camel-core/src/test/java/org/apache/camel/processor/SamplingThrottlerTest.java:
##########
@@ -66,8 +68,9 @@ public void testBurstySampling() throws Exception {
 
         // send a burst of 5 exchanges, expecting only one to get through
         sendExchangesThroughDroppingThrottler(sentExchanges, 5);
-        // sleep through a complete period
-        Thread.sleep(1100);
+        // wait through a complete sampling period (1s) using Awaitility 
instead of Thread.sleep
+        
await().pollDelay(Duration.ofMillis(1100)).atMost(Duration.ofSeconds(3))
+                .untilAsserted(() -> assertTrue(true, "Sampling period 
elapsed"));

Review Comment:
   I do not understand what it is changign compared to thread.sleeP. it will 
always wait for the same amount of time



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to