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

   [CAMEL-23427](https://issues.apache.org/jira/browse/CAMEL-23427)
   
   Change `clearLogTraces()` from `@AfterEach` to `@BeforeEach` to ensure the 
trace log file is rolled over **before** each test runs, not after.
   
   **Root cause:** In JUnit 5, subclass `@AfterEach` methods run before 
superclass `@AfterEach`. This means 
`TelemetryDevTracerTestSupport.clearLogTraces()` (rollover) executes before 
`CamelTestSupport.tearDown()` (context stop). Any trace output emitted during 
context shutdown is written to the new clean log file and picked up by the next 
test as a stale trace, causing `assertEquals(1, traces.size())` to fail with 2.
   
   **Fix:** Rolling over `@BeforeEach` guarantees a clean log file regardless 
of what the previous test's shutdown did.


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