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

   # Description
   
   Attempt to stabilize the flaky `Test1SpringScheduledRoutePolicyTest` 
(CAMEL-26378), which fails with `expected: <Started> but was: <Stopped> within 
5 seconds`.
   
   **Suspected root cause** (deduced from the code, *not reproduced*): 
`startTest()` started the route (autoStartup), stopped it manually, then waited 
for the scheduled start to start it again. The `startPolicy` trigger fires at 
+1s and +2s after the Spring context creation (`SimplePolicies.xml`), and 
`ScheduledRoutePolicy.onJobExecute(START)` does nothing if the route is 
`Started`. On a slow/loaded machine both firings can happen before the manual 
stop, so nothing restarts the route and the await times out.
   
   **Change:** the route is now started with `autoStartup=false` in 
`startTest()` and the manual `stopRoute` is removed, so only the scheduled 
start can start the route and the test no longer depends on startup timing. 
Other tests keep the default.
   
   **Reproduction attempt:** 26 runs of the test without the change, pinned to 
2 CPUs with 6 busy loops, all passed, so the flakiness was not reproduced 
locally. The same loop was not run with the change. Whether this fixes the 
flakiness should be confirmed in Develocity after merge.
   
   # 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.
   - [ ] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   ---
   _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]

Reply via email to