Guillaume Nodet created CAMEL-24036:
---------------------------------------
Summary: Fix flaky AsyncWiretapTest in camel-telemetry and
camel-telemetry-dev
Key: CAMEL-24036
URL: https://issues.apache.org/jira/browse/CAMEL-24036
Project: Camel
Issue Type: Bug
Components: camel-telemetry
Reporter: Guillaume Nodet
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)