This is an automated email from the ASF dual-hosted git repository.
gnodet 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 7738b0f8099d CAMEL-22110: Fix flaky HazelcastQueueConsumerPollTest
(#22093)
7738b0f8099d is described below
commit 7738b0f8099d8d2af3b24e790a75a900017013f2
Author: Guillaume Nodet <[email protected]>
AuthorDate: Thu Mar 19 10:21:23 2026 +0100
CAMEL-22110: Fix flaky HazelcastQueueConsumerPollTest (#22093)
The mock queue.poll() returned "foo" on every call, so the consumer
kept sending messages to mock:result (67 instead of expected 1). Fix by
returning "foo" only once then null for subsequent calls. Also re-enable
the test on CI by removing @DisabledIfSystemProperty.
Co-authored-by: Claude Opus 4.6 <[email protected]>
---
.../camel/component/hazelcast/HazelcastQueueConsumerPollTest.java | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git
a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastQueueConsumerPollTest.java
b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastQueueConsumerPollTest.java
index 5d8c7d77a3a6..34de00ce0911 100644
---
a/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastQueueConsumerPollTest.java
+++
b/components/camel-hazelcast/src/test/java/org/apache/camel/component/hazelcast/HazelcastQueueConsumerPollTest.java
@@ -24,7 +24,6 @@ import com.hazelcast.core.HazelcastInstance;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.mock.MockEndpoint;
import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.mockito.Mock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -35,7 +34,6 @@ import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-@DisabledIfSystemProperty(named = "ci.env.name", matches = ".*",
disabledReason = "Flaky on GitHub Actions")
public class HazelcastQueueConsumerPollTest extends HazelcastCamelTestSupport {
private static final Logger LOG =
LoggerFactory.getLogger(HazelcastQueueConsumerPollTest.class);
@@ -59,7 +57,7 @@ public class HazelcastQueueConsumerPollTest extends
HazelcastCamelTestSupport {
@Test
public void add() throws InterruptedException {
- when(queue.poll(10000, TimeUnit.MILLISECONDS)).thenReturn("foo");
+ when(queue.poll(10000,
TimeUnit.MILLISECONDS)).thenReturn("foo").thenReturn(null);
MockEndpoint out = getMockEndpoint("mock:result");
out.expectedMessageCount(1);