You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2026/08/25 05:58:56 UTC

(camel) branch fix/CAMEL-24466 created (now 68580aaf15a6)

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

davsclaus pushed a change to branch fix/CAMEL-24466
in repository https://gitbox.apache.org/repos/asf/camel.git


      at 68580aaf15a6 CAMEL-24466: Fix flaky KafkaConsumerHealthCheckIT.testReadinessWhenDown

This branch includes the following new commits:

     new 68580aaf15a6 CAMEL-24466: Fix flaky KafkaConsumerHealthCheckIT.testReadinessWhenDown

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(camel) 01/01: CAMEL-24466: Fix flaky KafkaConsumerHealthCheckIT.testReadinessWhenDown

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch fix/CAMEL-24466
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 68580aaf15a6ca268a6e52074244463b77b4c718
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Aug 25 07:58:37 2026 +0200

    CAMEL-24466: Fix flaky KafkaConsumerHealthCheckIT.testReadinessWhenDown
    
    Readiness down-detection relies on the Kafka client's hasReadyNodes(), which only flips after connection-failure detection bounded by request.timeout.ms (default 30s). The 20s Awaitility window was shorter than that bound, so a killed-broker connection was not always detected in time, causing intermittent ConditionTimeout failures in CI (all 3 rerun attempts failed).
    
    Widen the await window to 45s and add a method-level @Timeout(60) (overriding the class-level @Timeout(30)) so detection can complete reliably. Both are upper bounds and Awaitility returns as soon as the condition is met, so passing runs are not slowed. Also drop unnecessary public modifiers per JUnit 5 conventions.
    
    Co-Authored-By: Claude Opus 4.8 <no...@anthropic.com>
    Signed-off-by: Claus Ibsen <cl...@gmail.com>
---
 .../kafka/integration/health/KafkaConsumerHealthCheckIT.java | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerHealthCheckIT.java b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerHealthCheckIT.java
index 6d46f6b25223..f608e6548759 100644
--- a/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerHealthCheckIT.java
+++ b/components/camel-kafka/src/test/java/org/apache/camel/component/kafka/integration/health/KafkaConsumerHealthCheckIT.java
@@ -64,7 +64,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
 @EnabledOnOs(value = { OS.LINUX, OS.MAC, OS.FREEBSD, OS.OPENBSD, OS.WINDOWS },
              architectures = { "amd64", "aarch64", "s390x" },
              disabledReason = "This test does not run reliably on ppc64le")
-public class KafkaConsumerHealthCheckIT extends KafkaHealthCheckTestSupport {
+class KafkaConsumerHealthCheckIT extends KafkaHealthCheckTestSupport {
     public static final String TOPIC = "test-health";
     public static final String SKIPPED_HEADER_KEY = "CamelSkippedHeader";
     public static final String PROPAGATED_CUSTOM_HEADER = "PropagatedCustomHeader";
@@ -167,15 +167,19 @@ public class KafkaConsumerHealthCheckIT extends KafkaHealthCheckTestSupport {
 
     @Order(5)
     @Test
+    @Timeout(60)
     @DisplayName("Tests that readiness reports down when it's actually down")
-    public void testReadinessWhenDown() {
+    void testReadinessWhenDown() {
         CamelContext context = contextExtension.getContext();
         // and shutdown Kafka which will make readiness report as DOWN
         service.shutdown();
         serviceShutdown = true;
 
-        // health-check readiness should be DOWN
-        await().atMost(20, TimeUnit.SECONDS).untilAsserted(() -> {
+        // Detecting a downed broker relies on the Kafka client's hasReadyNodes(), which only flips
+        // after connection-failure detection bounded by request.timeout.ms (default 30s). The await
+        // window must therefore exceed 30s (and the method-level @Timeout must exceed the await) to
+        // avoid a flaky ConditionTimeout under CI load. See CAMEL-24466.
+        await().atMost(45, TimeUnit.SECONDS).untilAsserted(() -> {
             Collection<HealthCheck.Result> res2 = HealthCheckHelper.invokeReadiness(context);
             Assertions.assertTrue(res2.size() > 0);
             Optional<HealthCheck.Result> down