apupier opened a new pull request, #29343: URL: https://github.com/apache/camel/pull/29343
# Description `ConsulMasterIT` still failed on Jenkins with `expected: <3> but was: <0>` after #29228 (namespaces, thread-safe results, `finally`), so that change did not cover this failure. The three Consul cluster ITs started the `CamelContext` inside `Awaitility.untilAsserted(() -> assertDoesNotThrow(context::start))`. On a slow machine the start can take longer than the 10 seconds default timeout of Awaitility. Awaitility then interrupts the thread, which aborts the Consul requests of the start (`InterruptedIOException` in `session/info`), so none of the nodes ever takes part in the leader election and no node completes. I reproduced it by running `ConsulMasterIT` with all CPUs saturated: 1 failure in 6 runs, with exactly this log (`ConsulException ... failed due to IOException` caused by `InterruptedIOException`, then `ConditionTimeoutException ... within 10 seconds`). With the fix, 8 runs under the same load all passed. The fix uses Awaitility only for the random delay before the start and calls `context.start()` directly. It is applied to `ConsulMasterIT`, `ConsulClusteredRoutePolicyIT` and `ConsulClusteredRoutePolicyFactoryIT`, which share the pattern. # 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). https://issues.apache.org/jira/browse/CAMEL-26381 # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. (test-only change in `camel-consul`, formatter and import sorter applied) # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. _AI-assisted: 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]
