apupier opened a new pull request, #30731: URL: https://github.com/apache/camel/pull/30731
## Description Fixes the flaky `SftpSimpleConsumeNoStartingDirIT` of [CAMEL-27278](https://issues.apache.org/jira/browse/CAMEL-27278) (since the build runs with `-T1C`) and removes the same weakness from the other `camel-mina-sftp` consumer tests. ### Cause The failure is `mock://result Received message count. Expected: <1> but was: <0>`, after the 10 s default wait of `MockEndpoint.assertIsSatisfied(context)`. The `camel-mina-sftp-test.log` of the failing Jenkins build (#2537) shows that the consumer did not hang on one step: every step of the first connection was slow, because many IT classes of the module run in the same JVM at the same time. Seconds after the route start: first poll at 0.7, SSH connect 1.1 to 1.6, authentication 1.6 to 6.2 (4.5 s), SFTP channel and `SSH_FXP_INIT` 6.2 to 8.5, `OPENDIR` 10.1, then the `READDIR` was still waiting when the test gave up. The first poll needs about 11 to 12 s on that agent, no file is lost. In the same build the 30 single-test SFTP classes of the module had a median of 9.9 s (about 1.3 s on an idle machine). Injecting a 12 s delay in any phase of the first SSH session of an embedded server (accept, key exchange, authentication, SFTP init, first request, file read) gives the same failure with the 10 s wait, and the consumer always recovers with a 30 s wait (about 13 s, 25 s when two connections in a row stall). ### Changes 1. `SftpSimpleConsumeNoStartingDirIT` (`camel-mina-sftp` and `camel-ftp`): wait 30 s instead of 10 s for the message. 2. 21 `camel-mina-sftp` consumer tests: remove `delay=10000`. The consumer polls every 500 ms instead of every 10 s, so a first poll that does not deliver the file is retried inside the 10 s the test waits. CAMEL-25881 did the same for `SftpSimpleConsumeNoStartingDirIT`. Several of these classes took 13 to 18 s in the failing build and passed only because their first poll succeeded. Only `camel-mina-sftp` gets the second change, it is the module that runs its integration test classes in parallel. The same pattern exists in 23 `camel-ftp` (JSch) tests, which showed shorter class times in the same build and have not been seen failing. ### Limits - This is a mitigation: the load of the CI agent is not changed. - The failure could not be reproduced without injecting the delay, even under heavy CPU load. - `camel-ftp` (JSch) was given the 30 s wait for consistency, its timing was not measured in detail. - The `SftpSimpleProduceDisconnectIT` mentioned in the ticket is not the same failure (`Broken pipe` after the server restart) and is addressed by CAMEL-27277. ### Verification - The 21 changed classes (29 tests) pass, one test is skipped as before (`SftpSimpleIPV6ConsumeIT`). - `SftpSimpleConsumeNoStartingDirIT` passes in `camel-mina-sftp` and `camel-ftp`. - Formatter and import sorter ran. _AI-generated description: IBM Bob 2.2.1 on behalf of @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]
