Repository navigation
Make test_select_racing_drop deterministic with a failpoint instead of a sleep - #131652
alexey-milovidov merged 1 commit into
Conversation
The test raced `DROP TABLE ... SYNC` against a direct `SELECT` by wall clock: the `SELECT` kept its plan open for ~3 s in a scalar subquery and pytest sent the `DROP` 1.2 s later, so the `DROP` had to reach the server within ~1.8 s. In `Integration tests (amd_msan, targeted)` on ClickHouse#112928 the `DROP`'s client needed 2.23 s to connect, the `SELECT` read the live metadata first and returned 0 without an error, and the assertion `'TABLE_IS_DROPPED' in ''` failed. Add a one-shot pause failpoint `object_storage_queue_pause_in_direct_select` in `StorageObjectStorageQueue::read()`, after the table is opened and before the read path takes the metadata handle. It parks the query thread during planning, never a pipeline worker inside `IProcessor::work()`. The test now enables it, starts the `SELECT`, waits for the pause, runs `DROP TABLE` (not `SYNC`: that waits for the paused `SELECT` to release the table), disables the failpoint and asserts `TABLE_IS_DROPPED`. One deterministic pass replaces the 10 sleep-based iterations. Same pattern as `nats_pause_before_checking_direct_select_connection` (ClickHouse#125494). Related: ClickHouse#112928 Related: ClickHouse#113695 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own cold review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261114-153300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-6:20261114-145100 |
|
Workflow [PR], commit [846c86a] Summary: ✅
AI ReviewSummaryPR #131652 replaces the sleep-based ordering in Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Slowest function optimization changes (ThinLTO)Median per-function time ratio to the master baseline:
Compile time of recompiled translation units8 translation units recompiled, 20 s compile time in total, 8 of them have a recent master baseline. |
4ba983e
Related: #112928
Related: #113695
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
test_storage_s3_queue/test_5.py::test_select_racing_dropfailed in Integration tests (amd_msan, targeted) on #112928 withiteration 3: assert 'TABLE_IS_DROPPED' in ''.The test ordered a
DROP TABLE ... SYNCagainst a directSELECTby wall clock: a 3 s scalar subquery and a 1.2 s sleep, so theDROPhad to reach the server within ~1.8 s. In that job theDROP's client needed 2.23 s to connect (0.25 s in the other iterations), so theSELECTread the live metadata first and returned0without an error. The server behaved correctly.Change: a one-shot pause failpoint
object_storage_queue_pause_in_direct_selectinStorageObjectStorageQueue::read(), after the table is opened and before the read path takes the metadata handle. It parks the query thread during planning, not a pipeline worker. The test enables it, starts theSELECT, waits for the pause, runsDROP TABLE(notSYNC, which would wait for the pausedSELECT), disables the failpoint and assertsTABLE_IS_DROPPED. One deterministic pass replaces the 10 sleep-based iterations. Same pattern asnats_pause_before_checking_direct_select_connectionfrom #125494.Validation: with a 2.5 s delay injected before the
DROP, the old test fails on master with the CI message. The new test passes 50/50, still passes with 5 s delays around theDROP, fails when theDROPis removed, and fails when theLOGICAL_ERRORthat #113695 fixed is restored.test_5.pypasses 36/36.Workflow [PR]
Sync PR [sync-upstream/pr/131652]
Version info
26.11.1.2371-master(included in26.11and later)