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

   ## Summary
   
   Fixes [CAMEL-25191](https://issues.apache.org/jira/browse/CAMEL-25191) — 
flaky test `MainNotAutoConfiguredWarningTest`.
   
   ## Root Cause
   
   `MainNotAutoConfiguredWarningTest` installs a custom WARN appender on the 
`BaseMainSupport` Log4j logger in `@BeforeEach`/`@AfterEach`, mutating global 
`LoggerContext` state. Under JUnit parallel execution, 
`AiObservabilityConfigurationPropertiesTest` concurrently emits WARN logs for 
unconsumed `camel.aiObservability.enable` properties (loaded from 
`ai-observability-unknown.properties`). These logs leak into the test appender 
and cause assertion failures (17% rate normally, 78% with `-T1C`).
   
   ## Fix
   
   Add `@Isolated` to prevent concurrent test execution while the 
`LoggerContext` is modified. This is consistent with the existing pattern used 
by `MainPropertyPlaceholderTest`, `MainEnvVarComponentConfigTest`, 
`MainPropertyPlaceholderWithEnvTest`, `MainPropertyPlaceholderWithSystemTest`, 
and `MainBootstrapEdgeCasesTest` in the same module.
   
   Also drop `public` modifiers from class and method declarations per JUnit 5 
/ AGENTS.md conventions.
   
   ## Testing
   
   `mvn test -pl core/camel-main -am -Dtest=MainNotAutoConfiguredWarningTest` — 
2/2 tests pass.


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