orpiske commented on code in PR #11060:
URL: https://github.com/apache/camel/pull/11060#discussion_r1290037992


##########
components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyFactoryIT.java:
##########
@@ -94,7 +95,7 @@ public void configure() {
 
             // Start the context after some random time so the startup order
             // changes for each test.
-            Thread.sleep(ThreadLocalRandom.current().nextInt(500));
+            
Awaitility.await().atMost(ThreadLocalRandom.current().nextInt(500), 
TimeUnit.MILLISECONDS);

Review Comment:
   This is missing the terminal operation. You need to add something like 
`untilAsserted`, `until` or similar.
   
   I believe we need something similar to this:
   
   
   ```
   Awaitility.await().pollDelay(ThreadLocalRandom.current().nextInt(500), 
TimeUnit.MILLISECONDS).untilAsserted(() -> 
Assertions.assertDoesNotThrow(context::start));
   ```
   
   



##########
components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulMasterIT.java:
##########
@@ -92,7 +93,7 @@ public void configure() {
 
             // Start the context after some random time so the startup order
             // changes for each test.
-            Thread.sleep(ThreadLocalRandom.current().nextInt(500));
+            
Awaitility.await().atMost(ThreadLocalRandom.current().nextInt(500), 
TimeUnit.MILLISECONDS);

Review Comment:
   Same as above.



##########
components/camel-consul/src/test/java/org/apache/camel/component/consul/cluster/ConsulClusteredRoutePolicyIT.java:
##########
@@ -94,7 +95,7 @@ public void configure() throws Exception {
 
             // Start the context after some random time so the startup order
             // changes for each test.
-            Thread.sleep(ThreadLocalRandom.current().nextInt(500));
+            
Awaitility.await().atMost(ThreadLocalRandom.current().nextInt(500), 
TimeUnit.MILLISECONDS);

Review Comment:
   Same as above.



-- 
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: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to