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 2020/01/03 11:20:37 UTC

[camel] 04/06: Fixed test to be more robust

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

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

commit f56ae29dd568dc615798b0a8018d04e20e422d22
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jan 3 12:07:15 2020 +0100

    Fixed test to be more robust
---
 .../apache/camel/impl/DefaultConsumerTemplateTest.java   | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultConsumerTemplateTest.java b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultConsumerTemplateTest.java
index d436db2..c9e1412 100644
--- a/core/camel-core/src/test/java/org/apache/camel/impl/DefaultConsumerTemplateTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/impl/DefaultConsumerTemplateTest.java
@@ -343,9 +343,11 @@ public class DefaultConsumerTemplateTest extends ContextTestSupport {
             template.receiveNoWait(e);
         }
 
-        // the eviction is async so force cleanup
-        template.cleanUp();
-        await().atMost(1, TimeUnit.SECONDS).until(() -> template.getCurrentCacheSize() == 500);
+        await().atMost(3, TimeUnit.SECONDS).until(() -> {
+            // the eviction is async so force cleanup
+            template.cleanUp();
+            return template.getCurrentCacheSize() == 500;
+        });
         assertEquals("Size should be 500", 500, template.getCurrentCacheSize());
         template.stop();
 
@@ -366,9 +368,11 @@ public class DefaultConsumerTemplateTest extends ContextTestSupport {
             template.receiveNoWait(e);
         }
 
-        // the eviction is async so force cleanup
-        template.cleanUp();
-        await().atMost(1, TimeUnit.SECONDS).until(() -> template.getCurrentCacheSize() == 500);
+        await().atMost(3, TimeUnit.SECONDS).until(() -> {
+            // the eviction is async so force cleanup
+            template.cleanUp();
+            return template.getCurrentCacheSize() == 500;
+        });
         assertEquals("Size should be 500", 500, template.getCurrentCacheSize());
         template.stop();