apupier opened a new pull request, #30780:
URL: https://github.com/apache/camel/pull/30780

   # Description
   
   Fix the flakiness (about 2% of the runs) of three tests of 
`SftpProducerStopDuringHungUploadIT`:
   
   - `stopOutsideForcedShutdownWaitsForUpload`
   - `stopDoesNotWaitForUploadBlockedWritingToHalfOpenConnection`
   - `gracefulStopWaitsForUploadOfRouteWhoseConsumerStopsRightAway`
   
   They fail with:
   
   ```
   java.lang.IllegalStateException: Executor has been shut down
       at 
org.apache.sshd.common.util.threads.NoCloseExecutor.execute(NoCloseExecutor.java:100)
       at sun.nio.ch.AsynchronousChannelGroupImpl.executeOnPooledThread(...)
       ...
       at sun.nio.ch.EPollPort$EventHandlerTask.run(EPollPort.java:305)
   ```
   
   The exception is thrown by a NIO2 event thread of an embedded SSHD server 
that is being stopped when a read completes. It is unrelated to what the test 
awaits, but Awaitility fails any `await()` when **any** thread of the JVM 
throws an uncaught exception. The three flaky tests are exactly the ones that 
use `await()` (two of them through `assertStopWaitsForUploadThatThenCompletes`).
   
   The fix is to use `dontCatchUncaughtExceptions()` on the two `await()` calls 
of the test (the same is done in `camel-mllp` tests). Only test code is changed.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   [CAMEL-27540](https://issues.apache.org/jira/browse/CAMEL-27540)
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   Verified locally with `mvn verify 
-Dit.test=SftpProducerStopDuringHungUploadIT` in `components/camel-ftp` (5 
tests pass); formatter and impsort produce no change. Since the flake is about 
2%, a single run cannot prove it is gone.
   
   ---
   _Claude Code... no: IBM Bob (AI agent) on behalf of Aurélien Pupier 
(@apupier)_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to