Skip to content

Conversation

@andrross
Copy link
Member

This commit removes a non-deterministic sleep and properly asserts that the AutoForceMergeManager completes quickly when interrupted. The previous test logic had a race condition where it checked the interrupt status of the thread, but that could return false if the thread was in the process of catching the InterruptException but had not yet reset the interrupt flag of the thread. The new logic is to set the delay to be the maximum of 60 seconds and assert that the test thread exits more quickly than that due to being interrupted.

Related Issues

Resolves #18820

Check List

  • Functionality includes testing.

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.

This commit removes a non-deterministic sleep and properly asserts that
the AutoForceMergeManager completes quickly when interrupted. The
previous test logic had a race condition where it checked the interrupt
status of the thread, but that could return false if the thread was in
the process of catching the InterruptException but had not yet reset the
interrupt flag of the thread. The new logic is to set the delay to be
the maximum of 60 seconds and assert that the test thread exits more
quickly than that due to being interrupted.

Signed-off-by: Andrew Ross <[email protected]>
@andrross andrross force-pushed the fix-AutoForceMergeManagerTests branch from 717ea14 to d10335a Compare August 11, 2025 21:14
@github-actions
Copy link
Contributor

✅ Gradle check result for d10335a: SUCCESS

@codecov
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.92%. Comparing base (86ac3ab) to head (d10335a).
⚠️ Report is 15 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #19024      +/-   ##
============================================
- Coverage     72.92%   72.92%   -0.01%     
- Complexity    69383    69389       +6     
============================================
  Files          5645     5645              
  Lines        318787   318787              
  Branches      46125    46125              
============================================
- Hits         232481   232472       -9     
- Misses        67458    67492      +34     
+ Partials      18848    18823      -25     

☔ 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.

@andrross andrross merged commit 28b852d into opensearch-project:main Aug 12, 2025
31 checks passed
@andrross andrross deleted the fix-AutoForceMergeManagerTests branch August 12, 2025 22:12
RajatGupta02 pushed a commit to RajatGupta02/OpenSearch that referenced this pull request Aug 18, 2025
…t#19024)

This commit removes a non-deterministic sleep and properly asserts that
the AutoForceMergeManager completes quickly when interrupted. The
previous test logic had a race condition where it checked the interrupt
status of the thread, but that could return false if the thread was in
the process of catching the InterruptException but had not yet reset the
interrupt flag of the thread. The new logic is to set the delay to be
the maximum of 60 seconds and assert that the test thread exits more
quickly than that due to being interrupted.

Signed-off-by: Andrew Ross <[email protected]>
atris pushed a commit to atris/OpenSearch that referenced this pull request Aug 28, 2025
…t#19024)

This commit removes a non-deterministic sleep and properly asserts that
the AutoForceMergeManager completes quickly when interrupted. The
previous test logic had a race condition where it checked the interrupt
status of the thread, but that could return false if the thread was in
the process of catching the InterruptException but had not yet reset the
interrupt flag of the thread. The new logic is to set the delay to be
the maximum of 60 seconds and assert that the test thread exits more
quickly than that due to being interrupted.

Signed-off-by: Andrew Ross <[email protected]>
kh3ra pushed a commit to kh3ra/OpenSearch that referenced this pull request Sep 5, 2025
…t#19024)

This commit removes a non-deterministic sleep and properly asserts that
the AutoForceMergeManager completes quickly when interrupted. The
previous test logic had a race condition where it checked the interrupt
status of the thread, but that could return false if the thread was in
the process of catching the InterruptException but had not yet reset the
interrupt flag of the thread. The new logic is to set the delay to be
the maximum of 60 seconds and assert that the test thread exits more
quickly than that due to being interrupted.

Signed-off-by: Andrew Ross <[email protected]>
vinaykpud pushed a commit to vinaykpud/OpenSearch that referenced this pull request Sep 26, 2025
…t#19024)

This commit removes a non-deterministic sleep and properly asserts that
the AutoForceMergeManager completes quickly when interrupted. The
previous test logic had a race condition where it checked the interrupt
status of the thread, but that could return false if the thread was in
the process of catching the InterruptException but had not yet reset the
interrupt flag of the thread. The new logic is to set the delay to be
the maximum of 60 seconds and assert that the test thread exits more
quickly than that due to being interrupted.

Signed-off-by: Andrew Ross <[email protected]>
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 AutoForceMergeManagerTests

2 participants