Repository navigation
LoggingDistTest.httpAccessLogNotNamedPattern is not stable - #45943
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1 of 2 tasks
namanONcode
force-pushed
the
Issue-45522
branch
from
February 2, 2026 19:54
adcb5c8 to
a8f0598
Compare
…nous log messages. Signed-off-by: NAMAN JAIN <naman.049259@tmu.ac.in>
ahus1
approved these changes
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: The LoggingDistTest.httpAccessLogNotNamedPattern test has been failing intermittently due to a race condition.
Closes #45522
Root Cause: When the test makes an HTTP request and immediately asserts on the log output, there's a timing window where the async log reader thread hasn't yet captured the access log message. The
CLIResult.getOutput()returns the current state of the output buffer, which may not include the log entry yet.Fix: Use
Awaitility.await().atMost(5, TimeUnit.SECONDS).untilAsserted()to poll for log messages instead of immediate assertions. This pattern:Polls repeatedly until the assertion passes or timeout is reached
Is already used in other similar tests like JaxRsDistTest.requestFilterTest
Properly handles the asynchronous nature of log capture
Changes:
Added Awaitility import to
LoggingDistTest.java
Wrapped log assertions in
httpAccessLogNotNamedPattern
with Awaitility polling
Applied the same fix to
testLogMdcShowingInTheLogs
which had the same potential issue
Renamed reassigned cliResult to fileCliResult to make the original effectively final for lambda usage
Testing
mvn test -Dtest=LoggingDistTest#httpAccessLogNotNamedPattern - PASSED
mvn test -Dtest=LoggingDistTest#testLogMdcShowingInTheLogs - PASSED
mvn spotless:check - PASSED