You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2026/07/03 12:03:00 UTC

[jira] [Resolved] (CAMEL-23892) Fix flaky camel-sql JDBC aggregate surefire tests on JDK 17 and JDK 25

     [ https://issues.apache.org/jira/browse/CAMEL-23892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet resolved CAMEL-23892.
-------------------------------------
    Resolution: Fixed

> Fix flaky camel-sql JDBC aggregate surefire tests on JDK 17 and JDK 25
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-23892
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23892
>             Project: Camel
>          Issue Type: Test
>          Components: camel-sql
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>            Priority: Major
>              Labels: test-flaky
>             Fix For: 4.22.0
>
>
> Several JDBC aggregation repository tests in camel-sql fail intermittently during CI on both JDK 17 and JDK 25 (maven-surefire-plugin), even with rerunFailingTestsCount=2.
> The root cause is the use of Thread.sleep() for test synchronization, which is unreliable under CI load:
> * *JdbcAggregateCompletionIntervalTest*: Thread.sleep(2000) + Thread.sleep(6000) to time messages around the completion interval — fails when the interval fires at unexpected times under load
> * *JdbcAggregateDiscardOnTimeoutTest*: Thread.sleep(2000) to wait for a 1-second timeout — fails when timeout fires late under load. Also had an incorrect expected body value and a non-asserting mock.await() call
> * *JdbcAggregationRepositoryRecoverExistingTest*: Thread.sleep(1000) between repo stop/start — fails if repo shutdown takes longer under load
> * Several concurrent/load tests used Thread.sleep(3) in Callable blocks
> The fix replaces all Thread.sleep() calls with Awaitility-based polling or TimeUnit.MILLISECONDS.sleep(), following the project convention.



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