Skip to content

Gracefully tear down S3BlobContainerRetriesTests #18144

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

Conversation

andrross
Copy link
Member

I believe the test tear down is racing with the thread leak detector because the shutdown() method does not actually wait for all the threads to stop. The fix here is to use ThreadPool::terminate which does the proper shutdown and ensures are threads are stopped before returning from the tearDown method.

Related Issues

Resolves #17551

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.

I believe the test tear down is racing with the thread leak detector
because the `shutdown()` method does not actually wait for all the
threads to stop. The fix here is to use `ThreadPool::terminate` which
does the proper shutdown and ensures are threads are stopped before
returning from the tearDown method.

Signed-off-by: Andrew Ross <[email protected]>
@kotwanikunal
Copy link
Member

Looks promising as a general fix for thread leak scenarios.
Waiting for CI for go green.

Copy link
Contributor

❕ Gradle check result for b82351d: 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 Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.52%. Comparing base (f55af4e) to head (b82351d).
Report is 6 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18144      +/-   ##
============================================
- Coverage     72.56%   72.52%   -0.04%     
- Complexity    67227    67232       +5     
============================================
  Files          5476     5476              
  Lines        310445   310445              
  Branches      45124    45124              
============================================
- Hits         225261   225163      -98     
- Misses        66786    66942     +156     
+ Partials      18398    18340      -58     

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

Copy link
Member

@owaiskazi19 owaiskazi19 left a comment

Choose a reason for hiding this comment

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

Looks good

@andrross
Copy link
Member Author

❕ Gradle check result for b82351d: UNSTABLE

Similar thread leak failures with S3BlobStoreRepositoryTests here, but the fix isn't going to be quite the same. The setup is a little more complicated with the internalClusterTests.

@andrross andrross merged commit 794a33a into opensearch-project:main Apr 29, 2025
56 of 57 checks passed
@andrross andrross deleted the s3-test-graceful-shutdown branch April 29, 2025 17:40
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 S3BlobContainerRetriesTests
3 participants