You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/07/06 08:16:10 UTC

[PR] CAMEL-23920: Fix flaky tests in camel-ftp by replacing Thread.sleep with Awaitility [camel]

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

   ## Summary
   
   _Claude Code on behalf of Guillaume Nodet_
   
   Replace `Thread.sleep` calls with Awaitility-based polling in three camel-ftp test classes to eliminate flaky timing-dependent behavior:
   
   - **FtpProducerTempFileExistIssueIT**: Replace 5× `Thread.sleep(500)` with Awaitility file-existence checks before proceeding to the next send operation. Also increase existing assertion timeouts from 500ms to 5s for CI resilience.
   - **FtpConsumerIdempotentIT**: Remove `Thread.sleep(100)` after initial assertion, replace `Thread.sleep(2000)` with `await().pollDelay(2, SECONDS).atMost(5, SECONDS).untilAsserted(...)` for the negative assertion (verifying idempotent consumer does NOT re-consume a file).
   - **FtpConsumerIdempotentRefIT**: Same pattern as `FtpConsumerIdempotentIT`.
   
   ## Test plan
   
   - [x] All 8 tests pass locally (`FtpProducerTempFileExistIssueIT` × 6, `FtpConsumerIdempotentIT` × 1, `FtpConsumerIdempotentRefIT` × 1)
   - [ ] CI build passes
   - [x] No `Thread.sleep` calls remain in the modified files
   - [x] Code formatted with `mvn formatter:format impsort:sort`
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23920: Replace Thread.sleep with Awaitility in camel-ftp tests [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #24444:
URL: https://github.com/apache/camel/pull/24444#issuecomment-4891529616

   _Claude Code on behalf of Guillaume Nodet_
   
   Closing — this fix was not validated by running the test 100 times first. Will re-dispatch with a validation-first approach: run the test 100x, and only create a JIRA + fix if it actually fails.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23920: Fix flaky tests in camel-ftp by replacing Thread.sleep with Awaitility [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24444:
URL: https://github.com/apache/camel/pull/24444#issuecomment-4891037494

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `components/camel-ftp`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 1 tested, 0 compile-only — current: 12 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **1 affected modules** (current approach: 12).
   
   <details><summary>Modules only in current approach (11)</summary>
   
   - `camel-azure-files`
   - `camel-jbang-mcp`
   - `camel-jbang-plugin-mcp`
   - `camel-jbang-plugin-route-parser`
   - `camel-jbang-plugin-tui`
   - `camel-jbang-plugin-validate`
   - `camel-jsch`
   - `camel-launcher-container`
   - `camel-yaml-dsl-validator`
   - `camel-yaml-dsl-validator-maven-plugin`
   - `camel-zookeeper-master`
   
   </details>
   
   **Skip-tests mode would test 1 modules** (1 direct + 0 downstream), **skip tests for 0** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (1)</summary>
   
   - `camel-ftp`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   <details><summary>All tested modules (12 modules)</summary>
   
   - Camel :: Azure :: Files
   - Camel :: FTP
   - Camel :: JBang :: MCP
   - Camel :: JBang :: Plugin :: MCP
   - Camel :: JBang :: Plugin :: Route Parser
   - Camel :: JBang :: Plugin :: TUI
   - Camel :: JBang :: Plugin :: Validate
   - Camel :: Jsch
   - Camel :: Launcher :: Container
   - Camel :: YAML DSL :: Validator
   - Camel :: YAML DSL :: Validator Maven Plugin
   - Camel :: Zookeeper Master
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/28777616236)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23920: Fix flaky tests in camel-ftp by replacing Thread.sleep with Awaitility [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #24444:
URL: https://github.com/apache/camel/pull/24444#issuecomment-4890584970

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23920: Fix flaky tests in camel-ftp by replacing Thread.sleep with Awaitility [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #24444:
URL: https://github.com/apache/camel/pull/24444#issuecomment-4891202369

   _Claude Code on behalf of Guillaume Nodet_
   
   📋 **Process note**: Before undrafting, the test(s) modified in this PR should be run 100 times (e.g. with `mvn test -Dsurefire.rerunFailingTestsCount=0 -Dtest=<TestClass> -pl <module> -Dsurefire.runCount=100`) to confirm they are actually flaky. If they pass 100/100 without the fix, the change may not be needed.
   
   Also ensure:
   - MockEndpoint helpers (`assertIsSatisfied()` already waits 10s, `setResultWaitTime()`, `setAssertPeriod()`) are used where appropriate instead of Awaitility wrappers
   - Valid `Thread.sleep()` calls (UDP pacing, simulation delays, "wait to confirm nothing happens") are preserved


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23920: Replace Thread.sleep with Awaitility in camel-ftp tests [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #24444:
URL: https://github.com/apache/camel/pull/24444#issuecomment-4891488297

   @copilot review


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-23920: Replace Thread.sleep with Awaitility in camel-ftp tests [camel]

Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed pull request #24444: CAMEL-23920: Replace Thread.sleep with Awaitility in camel-ftp tests
URL: https://github.com/apache/camel/pull/24444


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org