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

   [CAMEL-23495](https://issues.apache.org/jira/browse/CAMEL-23495)
   
   Replace `Thread.sleep()` synchronization calls with Awaitility in 15 test 
files across camel-core and camel-management to reduce flakiness under CI load.
   
   ## Changes by category
   
   ### Suspend/resume tests (4 files)
   - `RouteSedaSuspendResumeTest`, `DefaultCamelContextSuspendResumeRouteTest`, 
`TwoRouteSuspendResumeTest`, `SedaConsumerSuspendResumeTest`
   - Replaced `Thread.sleep(1000L)` + existing `await()` with a single 
`await().pollDelay(1s).atMost(5s)` to give SEDA consumer thread time to idle 
after route suspension
   
   ### Management tests (2 files)
   - `ManagedInflightStatisticsTest` — replaced `Thread.sleep(250)` and 
`Thread.sleep(200)` with `await().until()` checking JMX inflight exchange count
   - `DefaultExecutorServiceManagerTest` — replaced `Thread.sleep(3000)` with a 
`started` CountDownLatch + `await()` to detect when the pool task begins
   
   ### Async/scheduler tests (2 files)
   - `SchedulerMulticastParallelGreedyTest` — replaced `Thread.sleep(50)` with 
`MockEndpoint.setAssertPeriod(200)` to verify no extra messages arrive
   - `ThreadsRejectedExecutionWithDeadLetterTest` — replaced 
`Thread.sleep(100)` with `await().until()` checking the rejected message 
arrived at dead letter
   
   ### Aggregation tests (3 files)
   - `AggregateGroupedExchangeBatchSizeTest` — replaced `Thread.sleep(1000)` 
with `await()` for the second batch via completion timeout
   - `AggregateDiscardOnTimeoutTest` — replaced `Thread.sleep(250)` with 
`MockEndpoint.setAssertPeriod(500)`
   - `AggregateClosedCorrelationKeyTest` — replaced `Thread.sleep(200)` with 
`await().until()` checking all aggregated results arrived
   
   ### Redelivery/shutdown tests (3 files)
   - `NotAllowRedeliveryWhileStoppingTest`, 
`NotAllowRedeliveryWhileStoppingDeadLetterChannelTest` — replaced 
`Thread.sleep(500)` with `await()` checking inflight repository
   - `RedeliveryDeadLetterErrorHandlerNoRedeliveryOnShutdownTest` — replaced 
`Thread.sleep(500)` with `await().until(() -> counter.get() >= 20)`
   
   ### Resequencer test (1 file)
   - `ResequenceStreamRejectOldExchangesTest` — replaced `Thread.sleep(100)` 
with `await().until()` checking first message delivered before sending the rest
   
   ## Out of scope
   The following `Thread.sleep()` uses were intentionally left unchanged:
   - Sleeps inside `Processor.process()` or `Runnable.run()` simulating slow I/O
   - Timing-specific tests (completion intervals, rate calculations, timeout 
ordering)
   - Pacing sleeps between message sends where the delay is the test's intent
   
   _Claude Code on behalf of Guillaume Nodet_


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