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 1e8ba5c33d75 CAMEL-27157: camel-kafka - Fix flaky 
KafkaConsumerGroupInstanceIdIT
1e8ba5c33d75 is described below

commit 1e8ba5c33d75957880e289a908d224fab23797c3
Author: AurĂ©lien Pupier <[email protected]>
AuthorDate: Wed Nov 18 14:20:46 2026 +0100

    CAMEL-27157: camel-kafka - Fix flaky KafkaConsumerGroupInstanceIdIT
    
    The test adds the route and immediately polls describeConsumerGroups.
    The consumer group does not exist on the broker until the first consumer
    has joined it, so the call fails with GroupIdNotFoundException (wrapped
    in an ExecutionException). Awaitility's untilAsserted only retries on
    AssertionError, so the first poll that lost the race failed the test.
    
    Ignore ExecutionException while awaiting, so polling continues until the
    group exists and all static members have joined, still bounded by the
    60 seconds timeout.
    
    Co-authored-by: IBM Bob 2.2.1
    Signed-off-by: AurĂ©lien Pupier <[email protected]>
---
 .../component/kafka/integration/KafkaConsumerGroupInstanceIdIT.java    | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerGroupInstanceIdIT.java
 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerGroupInstanceIdIT.java
index 3963c3e581df..4c2de60bfc0b 100644
--- 
a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerGroupInstanceIdIT.java
+++ 
b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/KafkaConsumerGroupInstanceIdIT.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.kafka.integration;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
+import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
@@ -72,7 +73,9 @@ class KafkaConsumerGroupInstanceIdIT extends 
BaseKafkaTestSupport {
             }
         });
 
+        // the group does not exist until the first consumer has joined it: 
describing it fails with GroupIdNotFoundException
         await().atMost(60, TimeUnit.SECONDS)
+                .ignoreException(ExecutionException.class)
                 .untilAsserted(() -> assertEquals(Set.of("camel-0", "camel-1", 
"camel-2"), groupInstanceIds()));
 
         MockEndpoint result = 
contextExtension.getMockEndpoint(KafkaTestUtil.MOCK_RESULT);

Reply via email to