[
https://issues.apache.org/jira/browse/CAMEL-25191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125382#comment-18125382
]
Guillaume Nodet commented on CAMEL-25191:
-----------------------------------------
This issue is being investigated by a coding agent (on behalf of gnodet).
Root cause confirmed: MainNotAutoConfiguredWarningTest modifies the global
Log4j LoggerContext in @BeforeEach/@AfterEach by installing a custom appender
on BaseMainSupport's logger. When JUnit parallel execution runs concurrently,
AiObservabilityConfigurationPropertiesTest triggers WARN logs for unconsumed
camel.aiObservability.enable properties (from
ai-observability-unknown.properties), which leak into the test appender and
cause assertion failures.
Fix: add @Isolated annotation to MainNotAutoConfiguredWarningTest, consistent
with the existing pattern used in MainPropertyPlaceholderTest,
MainEnvVarComponentConfigTest, and similar tests in the same module that also
mutate global JVM state.
_Note: This comment was generated by an AI coding agent and requires manual
verification._
> Fix flaky test MainNotAutoConfiguredWarningTest
> -----------------------------------------------
>
> Key: CAMEL-25191
> URL: https://issues.apache.org/jira/browse/CAMEL-25191
> Project: Camel
> Issue Type: Test
> Components: camel-main
> Affects Versions: 4.23.0
> Reporter: Aurélien Pupier
> Assignee: Guillaume Nodet
> Priority: Major
>
> test added 2 days ago, it is flaky [17% of the time on Jenkins
> CI|https://develocity.apache.org/scans/tests?search.rootProjectNames=camel&search.tags=main&search.timeZoneId=Europe%2FParis&tests.container=org.apache.camel.main.MainNotAutoConfiguredWarningTest&tests.sortField=FLAKY]
> and 78% of the time when full build played with -T1C
> {noformat}
> org.opentest4j.AssertionFailedError: [Property not auto-configured:
> camel.aiObservability.enable=false] ==> expected: <true> but was: <false>
> at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:232)
> at
> org.apache.camel.main.MainNotAutoConfiguredWarningTest.testNoWarningsForValidConfiguration(MainNotAutoConfiguredWarningTest.java:108)
>
> {noformat}
> {noformat}
> org.opentest4j.AssertionFailedError: [Property not auto-configured:
> camel.aiObservability.enable=true, Property not auto-configured:
> camel.rest.contxtPath=/api, Property not auto-configured:
> camel.rest.password=xxxxxx] ==> expected: <2> but was: <3>
> at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:601)
> at
> org.apache.camel.main.MainNotAutoConfiguredWarningTest.testTypoIsLogged(MainNotAutoConfiguredWarningTest.java:84)
>
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)