gnodet commented on PR #24698:
URL: https://github.com/apache/camel/pull/24698#issuecomment-5035170161

   @apupier You're right — good call. Looking at the git history and your 
Develocity data, the original `Thread.sleep(200)` + `timeout=1000` was stable 
for 6 years (since 2020). The Awaitility `TIMED_WAITING` approach introduced in 
CAMEL-19549 (Jun 25/29) actually **introduced** the flakiness by changing the 
test from a race-tolerant design to a strict thread-ordering dependency.
   
   The original works regardless of which thread "wins" the race:
   - If `resumeRoute()` fires before `sendBody` starts blocking → route is 
already resumed, `sendBody` succeeds immediately
   - If `resumeRoute()` fires while `sendBody` is blocking → `sendBody` gets 
unblocked
   
   Both outcomes pass. The Awaitility approach broke this by requiring the 
background thread to observe `TIMED_WAITING` first, creating a strict ordering 
where the `atMost(2s)` and `sendBody` `timeout=2000` raced each other.
   
   I've pushed 7c2217a which reverts to the original race-tolerant semantics, 
using `ScheduledExecutorService.schedule(200ms)` instead of `Thread.sleep(200)` 
to comply with our no-sleep rule. Timeout restored to the original 1000ms.
   
   _Claude Code on behalf of @gnodet_


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