[ 
https://issues.apache.org/jira/browse/CAMEL-24029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18123338#comment-18123338
 ] 

Guillaume Nodet commented on CAMEL-24029:
-----------------------------------------

This issue is being investigated by a coding agent (on behalf of gnodet).

Root cause confirmed for the remaining flaky test:

*StopRouteAbortAfterTimeoutTest.testStopRouteWithAbortAfterTimeoutTrue()*

The route uses .delay(100) meaning 5 messages x 100ms = ~500ms total 
processing. The stopRoute() call uses a 1-second timeout with 
abortAfterTimeout=true. On fast CI machines, all 5 messages complete within 
500ms (well inside the 1-second timeout), so stopRoute returns true (route 
stopped cleanly), but the test expects false (abort triggered). This is a 
deterministic timing gap, not a true flaky issue.

PR #24630 only fixed the MockEndpoint assertion timeout (line 57) but did not 
address the primary race on line 48.

Fix: increase the delay from 100ms to 2000ms, so 5 x 2000ms = 10s ensures the 
1-second stopRoute timeout always expires before all messages are processed.

The other two tests (LoopNoBreakOnShutdownTest, 
DefaultCamelContextSuspendResumeRouteTest) are already fixed on main.

_Note: This comment was generated by an AI coding agent and requires manual 
verification._

> Fix flaky camel-core tests using timed assertions
> -------------------------------------------------
>
>                 Key: CAMEL-24029
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24029
>             Project: Camel
>          Issue Type: Test
>          Components: camel-core
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>            Priority: Major
>             Fix For: 4.22.0
>
>
> Several camel-core tests are flaky on CI due to missing explicit timeouts on 
> MockEndpoint assertions:
> - StopRouteAbortAfterTimeoutTest (3 flaky, 1 failed)
> - LoopNoBreakOnShutdownTest (7 flaky)
> - DefaultCamelContextSuspendResumeRouteTest (5 flaky)
> _Claude Code on behalf of gnodet_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to