Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Fix flaky test in testApproximateRangeWithSizeOverDefault by adjusting totalHits assertion logic #16459

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 66f0110 from #16434.

…ing totalHits assertion logic (#15807) (#16434)

- Updated the test to account for Lucene's behavior where `IndexSearcher.search()` may return `GREATER_THAN_OR_EQUAL_TO` for totalHits when the number of matches exceeds 1000.
- Added logic to check if `totalHits.relation` is `EQUAL_TO`. If so, assert that the count is exactly 11000. Otherwise, ensure the count is at least 11000 and within the allowed upper limit (`maxHits`).
- This change prevents intermittent test failures caused by Lucene’s performance optimizations.

Signed-off-by: inpink <[email protected]>
(cherry picked from commit 66f0110)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Copy link
Contributor

❕ Gradle check result for 5a19403: 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.

Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.81%. Comparing base (b771f78) to head (5a19403).
Report is 4 commits behind head on 2.x.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #16459      +/-   ##
============================================
- Coverage     71.86%   71.81%   -0.05%     
+ Complexity    65383    65359      -24     
============================================
  Files          5312     5312              
  Lines        304944   304953       +9     
  Branches      44426    44428       +2     
============================================
- Hits         219135   219010     -125     
- Misses        67555    67653      +98     
- Partials      18254    18290      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dbwiddis dbwiddis merged commit d27ee4e into 2.x Oct 23, 2024
62 checks passed
@dbwiddis dbwiddis deleted the backport/backport-16434-to-2.x branch October 23, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant