tmielke opened a new pull request, #26855:
URL: https://github.com/apache/camel/pull/26855

   # Description
   
   Fixes two distinct failure modes in 
\`MessageHistoryExceptionRouteTest.testMetricsHistory()\`.
   
   **Failure 1 — Race condition (\`expected: <5> but was: <4>\`):**
   Metric recording via \`nodeProcessingDone()\` happens asynchronously on seda 
threads. \`MockEndpoint.assertIsSatisfied()\` only waits for mock endpoints to 
receive messages, not for metrics to be flushed. The bare \`assertEquals()\` 
calls at lines 65–67 could run before all \`nodeProcessingDone()\` callbacks 
had fired. Fix: wrap all metric count assertions in a single 
\`await().untilAsserted()\` block.
   
   **Failure 2 — Cleanup failure on rerun (\`ConditionTimeoutException\`):**
   \`CamelOpenTelemetryExtension\` implements \`BeforeEachCallback\` and 
\`AfterEachCallback\`, but the \`otelExtension\` field in 
\`AbstractOpenTelemetryTestSupport\` was missing \`@RegisterExtension\`, so 
JUnit never invoked those lifecycle methods. On a test retry in the same JVM 
the SDK was neither reset nor reinitialized, causing metrics to be 
undetectable. Fix: add \`@RegisterExtension\` to \`otelExtension\` in 
\`AbstractOpenTelemetryTestSupport\`.
   
   ---
   _Claude Sonnet 4.5 on behalf of tmielke_"
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (Camel 4 
uses the `main` branch)
   
   # Tracking
   - [x] If this is a large change, bug fix, or code improvement, I checked 
there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for 
the change (usually before you start working on it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
and I have committed all auto-generated changes.
   
   # AI-assisted contributions
   
   - [x] If this PR includes AI-generated code, commits have proper 
co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR 
description identifies the AI tool used.
   
   


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