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

davsclaus pushed a commit to branch CAMEL-26638-hazelcast-flaky-test
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 3923d04fdaa4e276ce607de64dda261e73c9af09
Author: Claus Ibsen <[email protected]>
AuthorDate: Thu Nov 5 13:45:16 2026 +0100

    CAMEL-26638: camel-hazelcast - fix flaky 
HazelcastReliableTopicConsumerLossTest.listenerCancelledByHazelcastIsReported
    
    Hazelcast only cancels a reliable topic listener whose ringbuffer read is
    parked when the topic is destroyed. A first read that reaches the member
    after the destroy waits on a new ringbuffer, so the listener was never
    cancelled and the test timed out on a loaded CI machine. The test now
    destroys the topic again until the consumer reports it.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
    Signed-off-by: Claus Ibsen <[email protected]>
---
 .../hazelcast/HazelcastReliableTopicConsumerLossTest.java     | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git 
a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastReliableTopicConsumerLossTest.java
 
b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastReliableTopicConsumerLossTest.java
index de8fc0fcc267..52659be38e6d 100644
--- 
a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastReliableTopicConsumerLossTest.java
+++ 
b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastReliableTopicConsumerLossTest.java
@@ -120,10 +120,13 @@ class HazelcastReliableTopicConsumerLossTest extends 
CamelTestSupport {
 
     @Test
     void listenerCancelledByHazelcastIsReported() throws Exception {
-        // Hazelcast cancels the listener when the topic is destroyed: the 
consumer receives nothing more
-        member.getReliableTopic("news").destroy();
-
-        await().atMost(10, TimeUnit.SECONDS).until(() -> !reported.isEmpty());
+        // Hazelcast cancels the listener when the topic is destroyed: the 
consumer receives nothing more.
+        // Only a read of the listener that waits on the ringbuffer is 
cancelled; a read that reaches the member after
+        // the destroy waits on a new ringbuffer instead, so destroy the topic 
again until the consumer reports it
+        await().atMost(10, TimeUnit.SECONDS).pollInterval(200, 
TimeUnit.MILLISECONDS).until(() -> {
+            member.getReliableTopic("news").destroy();
+            return !reported.isEmpty();
+        });
         assertEquals(1, reported.size(), "Reported: " + reported);
         assertTrue(reported.get(0).contains("Hazelcast cancelled the listener 
of the reliable topic news"),
                 "Reported: " + reported);

Reply via email to