gnodet opened a new pull request, #24621: URL: https://github.com/apache/camel/pull/24621
## Summary Fix flaky `SjmsConnectionRecoveryTest.testRecoveryStopsAfterSuccessfulReconnection` which has a high failure rate on CI: **23 failures and 8 flaky runs out of 271 total runs** in the last 12 days ([Develocity test dashboard](https://develocity.apache.org)). **Root cause:** The test uses `asyncStartListener=true`, which means the SJMS consumer starts asynchronously in the background. The test sends messages immediately without waiting for the consumer to be fully subscribed. This was masked before commit c5d06bf2e25 because Awaitility's `untilAsserted()` was wrapping the MockEndpoint assertions, which had the side effect of retrying the entire send+assert cycle. When the redundant Awaitility wrapping was removed (correctly, for the general case), this test lost its implicit retry mechanism for the async consumer startup. **Failure modes observed on CI:** - `TimeoutException` after 10 minutes — the test hangs because the message sent in Phase 1 was lost (consumer not yet subscribed) - `JMSException: Failed to create session factory` — the send itself fails because the broker connection isn't fully established yet **Fix:** Wrap the send+assert cycles in Phases 1 and 5 with `Awaitility.untilAsserted()` to retry until the async consumer is ready. This is the correct use of Awaitility here — we are not wrapping a MockEndpoint assertion redundantly, but retrying an operation (sending a message) that can fail when the consumer hasn't started yet. ## Test plan - [ ] CI passes for `camel-sjms` module - [ ] `SjmsConnectionRecoveryTest` passes reliably (no more 10-minute timeouts) _Claude Code on behalf of gnodet_ -- 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]
