This is an automated email from the ASF dual-hosted git repository.

apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new 4d09cef1d83b CAMEL-22980 - avoid endless loop when Zookeeper GroupIT 
test is failing
4d09cef1d83b is described below

commit 4d09cef1d83b4ad3456b977277a217781e8669da
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Tue Feb 10 16:25:47 2026 +0100

    CAMEL-22980 - avoid endless loop when Zookeeper GroupIT test is failing
    
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 .../apache/camel/component/zookeepermaster/group/GroupIT.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-zookeeper-master/src/test/java/org/apache/camel/component/zookeepermaster/group/GroupIT.java
 
b/components/camel-zookeeper-master/src/test/java/org/apache/camel/component/zookeepermaster/group/GroupIT.java
index 0a983519186d..be003769356e 100644
--- 
a/components/camel-zookeeper-master/src/test/java/org/apache/camel/component/zookeepermaster/group/GroupIT.java
+++ 
b/components/camel-zookeeper-master/src/test/java/org/apache/camel/component/zookeepermaster/group/GroupIT.java
@@ -18,6 +18,7 @@ package org.apache.camel.component.zookeepermaster.group;
 
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
@@ -43,6 +44,7 @@ import org.testcontainers.containers.BindMode;
 import org.testcontainers.containers.SelinuxContext;
 
 import static org.apache.camel.test.junit5.TestSupport.deleteDirectory;
+import static org.awaitility.Awaitility.await;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -157,10 +159,11 @@ public class GroupIT {
                 group.update(new NodeState("foo" + i));
                 i++;
 
-                // wait for registration
-                while (group.getId() == null) {
-                    TimeUnit.MILLISECONDS.sleep(100);
-                }
+                await("Await for registration, the group must have an id")
+                        .atMost(Duration.ofSeconds(60))
+                        .pollDelay(Duration.ofMillis(100))
+                        .until(() -> group.getId() != null);
+
             }
 
             boolean firsStartedIsMaster = members.get(0).isMaster();

Reply via email to