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

davsclaus 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 ef1653f1138 Fix flaky test on CI
ef1653f1138 is described below

commit ef1653f11388149b17fe955f32ccba71b46a04bd
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sat Sep 28 19:45:17 2024 +0200

    Fix flaky test on CI
---
 .../camel/component/file/FileConsumerCommitRenameStrategyTest.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCommitRenameStrategyTest.java
 
b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCommitRenameStrategyTest.java
index 8565be81dc7..c358af33c5b 100644
--- 
a/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCommitRenameStrategyTest.java
+++ 
b/core/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCommitRenameStrategyTest.java
@@ -40,6 +40,8 @@ public class FileConsumerCommitRenameStrategyTest extends 
ContextTestSupport {
 
         template.sendBodyAndHeader(fileUri("reports"), "Hello Paris", 
Exchange.FILE_NAME, "paris.txt");
 
+        context.getRouteController().startAllRoutes();
+
         // wait a bit to give the filesystem time to complete the operation 
before checking the result
         mock.assertIsSatisfied(1000L);
     }
@@ -58,6 +60,7 @@ public class FileConsumerCommitRenameStrategyTest extends 
ContextTestSupport {
         mock.expectedBodiesReceived("Hello London");
 
         template.sendBodyAndHeader(fileUri("reports"), "Hello London", 
Exchange.FILE_NAME, "london.txt");
+        context.getRouteController().startAllRoutes();
 
         mock.assertIsSatisfied();
 
@@ -72,7 +75,8 @@ public class FileConsumerCommitRenameStrategyTest extends 
ContextTestSupport {
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                
from(fileUri("reports?move=../done/${file:name}&initialDelay=0&delay=10")).convertBodyTo(String.class)
+                
from(fileUri("reports?move=../done/${file:name}&initialDelay=0&delay=10")).autoStartup(false)
+                        .convertBodyTo(String.class)
                         .to("mock:report");
             }
         };

Reply via email to