Skip to content

Explicitly configure log4j for server tests#19426

Closed
cwperks wants to merge 1 commit intoopensearch-project:mainfrom
cwperks:configure-log4j
Closed

Explicitly configure log4j for server tests#19426
cwperks wants to merge 1 commit intoopensearch-project:mainfrom
cwperks:configure-log4j

Conversation

@cwperks
Copy link
Copy Markdown
Member

@cwperks cwperks commented Sep 25, 2025

Description

CI for the core repo has been flaky since the recent log4j update in #19184.

The same error has now been observed in both the core and AD repos:

REPRODUCE WITH: ./gradlew ':server:test' --tests 'org.opensearch.gateway.remote.RemoteClusterStateServiceTests.testReadClusterStateInParallel_ExceptionDuringRead' -Dtests.seed=7D187563E049ADC9 -Dtests.security.manager=true -Dtests.jvm.argline="-XX:TieredStopAtLevel=1 -XX:ReservedCodeCacheSize=64m" -Dtests.locale=saq-Latn-KE -Dtests.timezone=Pacific/Tahiti -Druntime.java=24

RemoteClusterStateServiceTests > testReadClusterStateInParallel_ExceptionDuringRead FAILED
    java.lang.AssertionError: 
    Expected: (an empty collection or iterable containing [a string starting with "No Root logger was configured, creating default ERROR-level Root logger with Console appender"] or iterable containing [a string starting with "No Root logger was configured, creating default ERROR-level Root logger with Console appender", a string starting with "No Root logger was configured, creating default ERROR-level Root logger with Console appender"])
         but: was <[An exception occurred processing Appender console, An exception occurred processing Appender console, An exception occurred processing Appender console]>
        at __randomizedtesting.SeedInfo.seed([7D187563E049ADC9:837EBCCE32AFF7B9]:0)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:18)
        at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
        at org.apache.lucene.tests.util.LuceneTestCase.assertThat(LuceneTestCase.java:2104)
        at org.opensearch.test.OpenSearchTestCase.checkStaticState(OpenSearchTestCase.java:740)
        at org.opensearch.test.OpenSearchTestCase.after(OpenSearchTestCase.java:506)

The changes in this PR will explicitly configure log4j to prevent it from falling back to the default.

Related Issues

Attempt to fix #19325

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Craig Perkins <cwperx@amazon.com>
@github-actions github-actions Bot added >test-failure Test failure from CI, local build, etc. autocut ClusterManager:RemoteState flaky-test Random test failure that succeeds on second run labels Sep 25, 2025
@github-actions
Copy link
Copy Markdown
Contributor

❌ Gradle check result for 64f74a7: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autocut ClusterManager:RemoteState flaky-test Random test failure that succeeds on second run >test-failure Test failure from CI, local build, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[AUTOCUT] Gradle Check Flaky Test Report for RemoteClusterStateServiceTests

1 participant