Repository navigation
Add test: max_execution_time arm of the new throw_if_cancelled check in DatabaseCatalog::undropTable is untested - #114095
clickgapai wants to merge 2 commits into
Conversation
|
Pre-PR Validation Gate (per ClickGap pipeline): a) Deterministic repro? ✅ b) Root cause explained? ✅ c) Fix matches root cause? ✅ d) Test intent preserved? / New tests added? ✅ e) Both directions demonstrated? ✅ f) Fix is general, not a narrow patch? ✅ |
|
Workflow [PR], commit [0d983a9] Summary: ❌
AI ReviewSummaryThis PR adds a stateless regression test for the Final Verdict
|
system.processes visibility alone is too weak: executeQueryImpl inserts the query into the process list before it resolves the table, so the DROP could win the race and the SELECT would never hold the storage. Wait for read_rows > 0 and elapsed > 1 instead.
3c8d3f4 to
0d983a9
Compare
|
CI failure in |
|
This is going to be flaky, the stress tests already test this |
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment.
This is a test-only PR — no source code changes. Please review: test quality, whether the claimed coverage gaps are real, and whether test output makes sense.
Adds test coverage for 1 untested code path, found during automated review of PR #113263.
That PR (1) The PR threads a
throw_if_cancelledcallback intoDatabaseCatalog::undropTableand calls it inside the busy-wait that waits for the dropped table'sStoragePtrto become unique;InterpreterUndropQuery::executeToTablebuilds the callback fromContext::getProcessListElementSafe+ `QuerySt1.
max_execution_timearm of the newthrow_if_cancelledcheck inDatabaseCatalog::undropTableis untestedsrc/Interpreters/DatabaseCatalog.cpp:1531,src/Interpreters/InterpreterUndropQuery.cpp:82Risk: The PR adds
if (throw_if_cancelled) throw_if_cancelled();to the busy-wait inDatabaseCatalog::undropTable; the callback isQueryStatus::throwIfKilled->QueryStatus::throwProperExceptionIfNeeded, which has two arms:cancel_reason == CancelReason::TIMEOUT->TIMEOUT_EXCEEDEDand everything else ->QUERY_WAS_CANCELLED. The PR's own test only reaches the second arm viaKILL QUERY. The first arm is reached from a different initiator (the backgroundCancellationCheckerthread, …What's unique vs PR tests:
04726_kill_undrop_table_busy_wait.shcancels the wait with an explicitKILL QUERYand assertsQUERY_WAS_CANCELLED. This test cancels the same wait through the query time limit: the cancellation is initiated by the backgroundCancellationCheckerrather than by a user query, and it asserts the other arm ofthrowProperExceptionIfNeeded(TIMEOUT_EXCEEDED). A change that honours onlyKILL QUERYpasses the PR's test and fails this one.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not applicable — test-only change.
Documentation entry for user-facing changes