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

Aurélien Pupier reopened CAMEL-24038:
-------------------------------------

the tests is even more flakier since the change, causin gmore failure (no mor 
eonly flaky)

https://develocity.apache.org/scans/tests?search.relativeStartTime=P90D&search.rootProjectNames=camel&search.timeZoneId=Europe%2FParis&tests.container=*AsyncWiretapTest

{noformat}
org.awaitility.core.ConditionTimeoutException: Assertion condition defined as a 
Lambda expression in org.apache.camel.telemetrydev.AsyncWiretapTest expected: 
<7> but was: <6> within 30 seconds.
        at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167)
        at 
org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119)
        at 
org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31)
        at 
org.awaitility.core.ConditionFactory.until(ConditionFactory.java:1160)
        at 
org.awaitility.core.ConditionFactory.untilAsserted(ConditionFactory.java:790)
        at 
org.apache.camel.telemetrydev.AsyncWiretapTest.testRouteMultipleRequests(AsyncWiretapTest.java:69)
Caused by: org.opentest4j.AssertionFailedError: expected: <7> but was: <6>
        at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:569)
        at 
org.apache.camel.telemetrydev.AsyncWiretapTest.lambda$testRouteMultipleRequests$0(AsyncWiretapTest.java:73)
{noformat}

> Fix flaky AsyncWiretapTest in camel-telemetry and camel-telemetry-dev
> ---------------------------------------------------------------------
>
>                 Key: CAMEL-24038
>                 URL: https://issues.apache.org/jira/browse/CAMEL-24038
>             Project: Camel
>          Issue Type: Test
>          Components: camel-telemetry
>            Reporter: Guillaume Nodet
>            Assignee: Guillaume Nodet
>            Priority: Major
>              Labels: test-flaky
>             Fix For: 4.22.0
>
>
> AsyncWiretapTest in both camel-telemetry and camel-telemetry-dev modules is 
> flaky in CI.
> Root cause: the test sends 10 messages through an async wiretap route with a 
> 2-second delay, then asserts on trace data. Traces are written asynchronously 
> after exchange processing.
> - camel-telemetry: used Thread.sleep(10000) to wait for traces - brittle and 
> slow
> - camel-telemetry-dev: had no wait at all before asserting trace counts
> - Both used mock.assertIsSatisfied(1000) with setAssertPeriod(5000) - 
> conflicting and insufficient timeout
> Fix by using Awaitility to poll until all traces with expected span counts 
> arrive, and MockEndpoint.assertIsSatisfied with a generous 30-second timeout.



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

Reply via email to