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 eb37011653af CAMEL-27558: Fix flaky test 
MinaSftpConsumerMaxMessagesPerPollListingIT (#30865)
eb37011653af is described below

commit eb37011653af350bb1b278c0ab8b207e7f0e682d
Author: Guillaume Nodet <[email protected]>
AuthorDate: Thu Nov 26 17:15:41 2026 +0100

    CAMEL-27558: Fix flaky test MinaSftpConsumerMaxMessagesPerPollListingIT 
(#30865)
    
    The consumesEveryFileOverThePolls test creates 300 files and polls in
    batches of 100 with maxMessagesPerPoll=100 and noop=true. With the
    CAMEL-26635 early-stop listing optimization, each successive poll must
    re-list the directory and skip already-consumed idempotent entries before
    finding new files, making later polls progressively slower. Combined with
    SFTP overhead, the 3rd poll often exceeds the default 10-second
    MockEndpoint timeout on slow or busy CI machines.
    
    Fix: replace mock.assertIsSatisfied() with the timed overload
    MockEndpoint.assertIsSatisfied(context, 30, TimeUnit.SECONDS).
    
    Co-authored-by: Claude Sonnet 4.6 <[email protected]>
---
 .../integration/MinaSftpConsumerMaxMessagesPerPollListingIT.java    | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/integration/MinaSftpConsumerMaxMessagesPerPollListingIT.java
 
b/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/integration/MinaSftpConsumerMaxMessagesPerPollListingIT.java
index ad59b5b8f41b..5689d139013d 100644
--- 
a/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/integration/MinaSftpConsumerMaxMessagesPerPollListingIT.java
+++ 
b/components/camel-mina-sftp/src/test/java/org/apache/camel/component/file/remote/mina/integration/MinaSftpConsumerMaxMessagesPerPollListingIT.java
@@ -21,6 +21,7 @@ import java.nio.file.FileAlreadyExistsException;
 import java.nio.file.FileSystemException;
 import java.nio.file.Files;
 import java.nio.file.Path;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
@@ -133,7 +134,10 @@ class MinaSftpConsumerMaxMessagesPerPollListingIT extends 
CamelTestSupport {
 
         consume("inbox", "&maxMessagesPerPoll=100&stepwise=false");
 
-        mock.assertIsSatisfied();
+        // With the CAMEL-26635 early-stop listing optimization and noop=true, 
each successive poll
+        // must re-list and skip idempotent entries before finding new files, 
making later polls
+        // progressively slower under SFTP overhead. 30 seconds avoids 
flakiness on slow machines.
+        MockEndpoint.assertIsSatisfied(context, 30, TimeUnit.SECONDS);
         assertEquals(service.directoriesOpened(), service.directoriesClosed(), 
"directories left open");
     }
 

Reply via email to