Fix flaky testWritesRejectedDueToTimeLagBreach#20869
Fix flaky testWritesRejectedDueToTimeLagBreach#20869andrross wants to merge 1 commit intoopensearch-project:mainfrom
Conversation
PR Reviewer Guide 🔍(Review updated until commit 0f4a2f1)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 0f4a2f1 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 0d42f4e
Suggestions up to commit 6df872b
|
|
❌ Gradle check result for 6df872b: 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? |
|
Persistent review updated to latest commit 0d42f4e |
|
❌ Gradle check result for 0d42f4e: 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? |
|
❌ Gradle check result for 0d42f4e: 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? |
The test assumed that a fixed number of index+refresh iterations during the failure phase would always accumulate enough time lag to trigger backpressure rejection. If the test machine is slow then upload time moving average might be inflated, raising the dynamic threshold (avgUploadTime * 10) beyond what the time lag can reach in only 3 iterations. Replace the fixed-iteration assertThrows with an assertBusy loop that keeps indexing until the backpressure rejection occurs or the 30-second timeout is reached. Signed-off-by: Andrew Ross <andrross@amazon.com>
|
Persistent review updated to latest commit 0f4a2f1 |
|
❕ Gradle check result for 0f4a2f1: 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 #20869 +/- ##
=======================================
Coverage ? 73.21%
Complexity ? 72468
=======================================
Files ? 5819
Lines ? 331352
Branches ? 47875
=======================================
Hits ? 242587
Misses ? 69258
Partials ? 19507 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The test assumed that a fixed number of index+refresh iterations during the failure phase would always accumulate enough time lag to trigger backpressure rejection. If the test machine is slow then upload time moving average might be inflated, raising the dynamic threshold (avgUploadTime * 10) beyond what the time lag can reach in only 3 iterations.
Replace the fixed-iteration assertThrows with an assertBusy loop that keeps indexing until the backpressure rejection occurs or the 30-second timeout is reached.
Related Issues
Resolves #17936
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.