Fix flaky test_database_delta::test_complex_table_schema timeout#96893
Merged
Fix flaky test_database_delta::test_complex_table_schema timeout#96893
Conversation
The `execute_spark_query` function kills lingering Spark processes with SIGKILL before starting a new session, but only removed the Derby `metastore_db/dbex.lck` lock file. After SIGKILL, the Derby metastore database can be left in a corrupted/inconsistent state, causing the next Spark session to hang during initialization until the 300-second timeout expires. Fix by removing the entire `metastore_db` directory (not just the lock file) and adding a brief wait after `pkill` for the killed process to fully release its resources. Closes: #79109 https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=f922e78f99e9d597e235631c57fc14e6fe0e0e71&name_0=MasterCI&name_1=Integration%20tests%20%28amd_asan%2C%20db%20disk%2C%20old%20analyzer%2C%204%2F6%29 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
scanhex12
approved these changes
Feb 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_complex_table_schematimeout by removing the entire Derbymetastore_dbdirectory instead of just the lock file before each Spark sessionpkill -9, the Derby database can be corrupted, causing the next Spark session to hang during initialization until the 300-second timeout expirespkillfor the killed process to fully release resourcesCloses #79109
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=f922e78f99e9d597e235631c57fc14e6fe0e0e71&name_0=MasterCI&name_1=Integration%20tests%20%28amd_asan%2C%20db%20disk%2C%20old%20analyzer%2C%204%2F6%29
Test plan
test_database_delta::test_complex_table_schemapasses in CI without timeoutstest_database_deltatests are not affectedChangelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code