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

   ## Summary
   
   _Claude Code on behalf of Guillaume Nodet_
   
   Replace `Thread.sleep()` calls with Awaitility `await()` in 
`core/camel-core` test files to address SonarCloud rule S2925.
   
   ### Changes
   
   Two files modified:
   
   - **`PollEnrichFileDefaultAggregationStrategyTest.java`** - Replaced 
`Thread.sleep(250)` (waiting for route startup) with `await().atMost(5, 
SECONDS).until(...)` checking that all routes have `ServiceStatus.Started`
   - **`ThrottlingExceptionRoutePolicyKeepOpenOnInitTest.java`** - Replaced two 
`Thread.sleep(500)` calls (waiting for circuit breaker half-open timer to fire) 
with `await().pollDelay(500, MILLISECONDS).atMost(2, 
SECONDS).untilAsserted(...)` verifying no messages were delivered
   
   ### Scope
   
   Only 2 of ~54 `Thread.sleep()` calls in `core/camel-core` tests were 
eligible for replacement. The remaining ~52 are legitimate:
   - Simulating I/O delays in test processors/producers (e.g., 
`MyAsyncProducer`, `VirtualThreadsLoadTest`)
   - Pacing message sends to test time-based assertions (e.g., 
`MockEndpointTimeClauseTest`, `SamplingThrottlerTest`)
   - Introducing timing gaps for aggregation/resequencer ordering tests
   - Located in manual tests (`*ManualTest.java`) not run in CI
   - Inside `ResequencerRunner`/`StreamResequencerTest` thread pacing for 
concurrency tests
   
   ## Test plan
   - [x] Both modified tests pass locally
   - [ ] CI passes
   - [ ] No `Thread.sleep()` remaining in modified files
   
   🤖 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