-
Notifications
You must be signed in to change notification settings - Fork 8k
Test: Fix thread leaks and unsafe DB drops in Replicated database tests #90338
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
Test: Fix thread leaks and unsafe DB drops in Replicated database tests #90338
Conversation
… integration tests - Stopped destroying system database 'default' (was breaking other tests) - Fixed thread leaks that could hang the entire test suite forever - Guaranteed thread cleanup with 'finally' blocks - All tests still pass, only stability improvements No server logic changed.
Algunenano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't merge master unnecessarily. Tests were failing correctly
Co-authored-by: Raúl Marín <[email protected]>
Co-authored-by: Raúl Marín <[email protected]>
Algunenano
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job. Thanks a lot for improving the tests!
|
Can you please avoid wording 'critical' etc. for test adjustments? Bad test is the issue for CI/CD, but nothing critical for the product itself. |
Changelog category (leave one):
Details
Fixes #90337
This PR fixes critical reliability issues and logic bugs in
tests/integration/test_database_replicated/test.pythat were causing test flakiness, potential hangs, and environment corruption.Key Changes
Fixed Thread Leaks / Race Conditions:
test_force_synchronous_settings, background threads (start_merges_threadandselect_thread) were joined after assertions. If an assertion failed, the threads were never joined and continued running in the background.ALTER TABLE) during subsequent tests, causing unpredictable failures and race conditions elsewhere in the suite.try...finallyblocks to guarantee cleanup regardless of test outcome.Prevented Destruction of
defaultDatabase:test_mv_false_cyclic_dependencywas executingDROP DATABASE default.test_cyclic_db(unique identifier) to ensure isolation.Stability Improvements:
Motivation
These changes are purely test-logic fixes. No server code is modified. The goal is to reduce CI flakiness and ensure that a failure in one test does not cascade into crashes in the rest of the suite.
Testing
Checklist