You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2022/08/26 07:08:07 UTC

[camel] 01/04: (chores) camel-jms: increase latch timeout

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

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

commit 7e91d98dc0dba354833c1bf28e6ad83abf51a9ff
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Aug 25 09:39:42 2022 +0200

    (chores) camel-jms: increase latch timeout
    
    Under load it may take a while for the async consumer/producer to run, causing the latch to timeout before the test completes
---
 .../java/org/apache/camel/component/jms/JmsPollingConsumerTest.java    | 3 +--
 .../component/jms/JmsRequestReplyExclusiveReplyToConcurrentTest.java   | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsPollingConsumerTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsPollingConsumerTest.java
index 4cb8f091bcc..b876d8e0264 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsPollingConsumerTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsPollingConsumerTest.java
@@ -121,8 +121,7 @@ public class JmsPollingConsumerTest extends AbstractJMSTest {
             MockEndpoint mock = getMockEndpoint("mock:result");
             mock.expectedBodiesReceived("Hello Claus");
 
-            // wait a little to demonstrate we can start poll before we have a msg on the queue
-            assertTrue(latch.await(500, TimeUnit.MILLISECONDS));
+            assertTrue(latch.await(1, TimeUnit.SECONDS));
             assertNull(body, "Message body should be null because the receive timed out");
 
             template.sendBody("direct:start", "Hello");
diff --git a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyExclusiveReplyToConcurrentTest.java b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyExclusiveReplyToConcurrentTest.java
index 505d4ba2ab3..cd117506ad8 100644
--- a/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyExclusiveReplyToConcurrentTest.java
+++ b/components/camel-jms/src/test/java/org/apache/camel/component/jms/JmsRequestReplyExclusiveReplyToConcurrentTest.java
@@ -71,7 +71,7 @@ public class JmsRequestReplyExclusiveReplyToConcurrentTest extends AbstractJMSTe
         LOG.info("Waiting to process {} messages...", size);
 
         // if any of the assertions above fails then the latch will not get decremented 
-        assertTrue(latch.await(10, TimeUnit.SECONDS), "All assertions outside the main thread above should have passed");
+        assertTrue(latch.await(20, TimeUnit.SECONDS), "All assertions outside the main thread above should have passed");
 
         long delta = watch.taken();
         LOG.info("Took {} millis", delta);