Skip to content

Add tolerance for matrix stats agg variance value assertion #18212

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

Merged
merged 1 commit into from
May 8, 2025

Conversation

bowenlan-amzn
Copy link
Member

@bowenlan-amzn bowenlan-amzn commented May 6, 2025

Description

After enabling the concurrent segment search by default, the variance result from matrix stats starts to flaky around the asserting value a little bit which seems coming from precision loss of float data.

The parallel search and randomness of segment layout are considered to be the cause of this flaky.

A quick look into how variance is calculated and a conversation with AI say "floating-point arithmetic not being perfectly associative", (A + B) + (C + D) slices group may not be same as A + B + C + D default sequential segment. Seem reasonable to me.

Tolerance is choosed based on the failed tests. Mismatch happens at the last digit
0.0000000000002
So choose
0.000000000001 to be the tolerance.

Related Issues

Resolves #18129

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.

@github-actions github-actions bot added >test-failure Test failure from CI, local build, etc. autocut flaky-test Random test failure that succeeds on second run labels May 6, 2025
Copy link
Contributor

github-actions bot commented May 6, 2025

✅ Gradle check result for 72b1e72: SUCCESS

Copy link

codecov bot commented May 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.55%. Comparing base (70e890a) to head (72b1e72).
Report is 7 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18212      +/-   ##
============================================
+ Coverage     72.52%   72.55%   +0.02%     
- Complexity    67228    67320      +92     
============================================
  Files          5476     5476              
  Lines        310470   310470              
  Branches      45131    45131              
============================================
+ Hits         225168   225247      +79     
+ Misses        66973    66912      -61     
+ Partials      18329    18311      -18     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bowenlan-amzn bowenlan-amzn marked this pull request as ready for review May 6, 2025 06:06
@bowenlan-amzn bowenlan-amzn requested a review from a team as a code owner May 6, 2025 06:06
Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with reservations. See unresolved comments.

@andrross andrross merged commit 60aa7a5 into opensearch-project:main May 8, 2025
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocut flaky-test Random test failure that succeeds on second run skip-changelog >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 SearchIT
3 participants