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

   ## Summary
   
   _Claude Code on behalf of gnodet_
   
   Fixes [CAMEL-23887](https://issues.apache.org/jira/browse/CAMEL-23887) — 
flaky `SjmsConnectionRecoveryTest` in camel-sjms surefire tests with ~13% 
failure rate (23 failures + 7 flaky out of 241 CI runs in the last 10 days on 
Develocity).
   
   **Root cause**: The test used a disguised `Thread.sleep()` via 
`await().until(() -> true)` — a hardcoded 4-second wait that doesn't adapt to 
slow CI environments. When recovery takes longer than expected, the assertion 
fires too early (wrong count) or the mock assertion hangs (10-minute surefire 
timeout).
   
   **Changes**:
   - **Phase 1/5**: Use `MockEndpoint.assertIsSatisfied(context, 30, 
TimeUnit.SECONDS)` instead of the instance method with default 10s timeout. The 
route uses `asyncStartListener=true`, so consumers may need more time on slow 
CI.
   - **Phase 3**: Replace `await().pollDelay(4s).until(() -> true)` (sleep 
disguised as Awaitility) with a condition-based wait: 
`await().atMost(30s).until(() -> createCount > connectionsBefore)`. This adapts 
to any CI speed.
   - **Phase 4**: Add a stabilization check — after confirming one recovery 
connection was created, wait 3 more recovery intervals and assert the count 
hasn't increased. This correctly detects the infinite-loop bug without relying 
on hardcoded timing.
   
   ## Test plan
   
   - [x] Compilation passes (`mvn compile test-compile -pl 
components/camel-sjms -am`)
   - [ ] `SjmsConnectionRecoveryTest` passes on CI (requires Docker for 
Testcontainers/Artemis)
   - [ ] No regressions in other camel-sjms surefire tests
   - [ ] Verify reduced flake rate on Develocity after merge
   
   🤖 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: [email protected]

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

Reply via email to