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

   # Description
   
   **JIRA:** https://issues.apache.org/jira/browse/CAMEL-25220
   
   The test occasionally failed with `mock://result Received message count 0, 
expected at least 2 within 10 seconds`: app-two had not recovered app-one's job 
yet when the wait ended.
   
   The test shuts down app-one, sleeps 2s, starts app-two and then waits with 
`Awaitility.await().untilAsserted(...)`, which uses Awaitility's default limit 
of 10 seconds. Quartz only declares a cluster node failed after its check-in 
interval (500 ms here) plus a fixed 7.5 s grace period, so the recovery alone 
takes most of that window before any message can arrive.
   
   A local run confirms the timing:
   - app-one stopped at 39.738
   - app-two's ClusterManager detected the failure at 47.906 (about 8.2 s later)
   - both messages arrived within 0.1 s after that
   
   So on an idle machine the wait already needs about 6 of its 10 seconds, and 
app-two's startup on a loaded CI machine is enough to use up the rest.
   
   The wait now has an explicit limit of 30 seconds (`atMost(30, 
TimeUnit.SECONDS)`), with a comment explaining why. The condition is unchanged, 
so a normal run still finishes as soon as the two messages arrive.
   
   Tests: `SpringQuartzConsumerTwoAppsClusteredRecoveryTest` passes locally.
   
   AI assistance: investigation and changes were done with help from Claude 
(Anthropic). I reviewed and verified the changes and tests locally.
   
   # 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).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   Built and tested camel-quartz; test-only change, no generated changes.
   
   # 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.


-- 
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