Fix flaky slowlog test#20726
Conversation
PR Reviewer Guide 🔍(Review updated until commit cc223fc)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to cc223fc Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 3eb29e8
Suggestions up to commit 72d6752
|
|
❌ Gradle check result for 72d6752: 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? |
72d6752 to
3eb29e8
Compare
|
Persistent review updated to latest commit 3eb29e8 |
|
❕ Gradle check result for 3eb29e8: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20726 +/- ##
============================================
- Coverage 73.29% 73.25% -0.05%
- Complexity 72088 72100 +12
============================================
Files 5794 5794
Lines 329733 329733
Branches 47577 47577
============================================
- Hits 241664 241532 -132
- Misses 68612 68788 +176
+ Partials 19457 19413 -44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: David Zane <davizane@amazon.com>
3eb29e8 to
cc223fc
Compare
|
Persistent review updated to latest commit cc223fc |
|
❌ Gradle check result for cc223fc: 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? |
Description
The
testMultipleSlowLoggersUseSingleLog4jLoggertest was flaky because it compared total logger counts in the LoggerContext before and after creating SearchRequestSlowLog instances. Other code paths (ClusterService creation, test framework, parallel tests) could register additional loggers between measurements, causing intermittent failures.Fixed by directly verifying the same logger instance is reused via assertSame(logger1, logger2) instead of counting total loggers.
Related Issues
Resolves #20665
Check List
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.