Repository navigation
Keep the finished-stages drain test away from the parallel suite - #117397
Conversation
The test closes with a wall-clock bound, `max(query_duration_ms) < 3000`. The regression it exists to catch costs a fixed amount of time regardless of hardware: `stage_poll_interval_ms` is 100 ms and the plan has about 40 stages, so a driver that drains one stage per poll parks for roughly 4 seconds. That is why an absolute bound was chosen over a relative one. The `parallel` job passes `--no-sequential` and runs the rest of the suite concurrently against a single server, so the same `query_duration_ms` also absorbs whatever the neighbouring tests are doing. A fixed signal is then being read through a channel whose noise, on that lane, reaches the signal's own order of magnitude. After the six exclusions the file already carries, every remaining timing failure is on one lane, `Stateless tests (arm_binary, parallel)`: 4 rows in 90 days out of 3234 runs, none on any `sequential` arm and none on `Fast test`. Two of the four are after the `make_distributed_plan = 0` fix landed, with that change present in the tested tree. `no-parallel` moves the test into the matching `sequential` job rather than skipping it, so the assertion keeps running, on a lane where wall time tracks machine time. Measured over 14 days on tests with a comparable p50, tail inflation p99.9/p50 averages 7.25 on `arm_binary, parallel` against 1.47 on `arm_binary, sequential`, and this test's own ratio on the parallel arm is 6.54. Since the signal is load-independent, the quieter lane widens the margin rather than narrowing it. `Fast test` is not affected by the tag and already contributes 1684 runs, none above 3000 ms. The oracle, the bound, the query and the reference file are unchanged. The comment is extended by one clause so it still names every exclusion it explains. Verified by the runner's own selection counts, both directions against the unmodified file: `--no-sequential` stops selecting the test, `--no-parallel` starts selecting it. Through the sequential runner it passes 10 of 10 plain runs and 50 of 50 with randomized settings.
Internal second-model review (click to expand)I reviewed this cold before reading my own implementation notes, then had an independent model
Two things I checked myself and could not fault. The destination job is real rather than assumed: The signature-A census in the description holds only once the |
|
Workflow [PR], commit [d314482] Summary: ✅ AI ReviewSummaryThis PR moves Final VerdictStatus: ✅ Approve |
7131e17
Requested by the reviewer to get a fresh CI run. Master at bb3c0a8 carries the fixes for all three failures on the previous head: ClickHouse#117397 (finished-stages drain test out of the parallel suite), ClickHouse#117364 (force the analyzer in 03707_autopr_unsupported_cases) and ClickHouse#117412 (integration tests' nested container budget).
Related: #116987
05047_distributed_plan_finished_stages_draincloses with a wall-clock bound,max(query_duration_ms) < 3000. The regression it catches costs a fixed ~4 seconds regardless ofhardware (
stage_poll_interval_ms = 100inReadFromDistributedPlanSource.htimes ~40 stages), so anabsolute bound fits. But the
paralleljob passes--no-sequentialand runs the rest of the suiteagainst one server, so that duration also absorbs neighbour load.
After the six exclusions already on the file, every remaining timing failure sits on one lane,
Stateless tests (arm_binary, parallel), and none onFast test. Two of the four are othercontributors' pull requests; the other two are mine, both after #116987 merged with its change present.
no-parallelmoves the test into the matchingsequentialjob rather than skipping it, so theassertion keeps running. I read the tag as strictly necessary in the sense
AGENTS.mdasks for: thetest is already parallel-safe the usual way (
currentDatabase()-scoped, no file I/O), so unique namingis not the missing piece, and machine time is the one resource a test cannot scope. Widening the bound
would stop it discriminating the regression, and the deterministic alternative was offered here and
declined during review of #116987.
The signal is load-independent, so the quieter lane raises the margin rather than lowering it: over 14
days, across tests with comparable p50 (400-1200 ms, >= 100 passing runs), tail inflation p99.9/p50
averages 7.25 on
arm_binary, parallelagainst 1.47 onarm_binary, sequential. This test hasnever run on a
sequentialjob, so that lane holds no history for it; the closest in-tree reference is01360_materialized_view_with_join_on_query_log, which also assertsquery_duration_msunderno-parallel: 27258 runs there in 90 days, 0 failures.Oracle, bound, query and
.referenceare byte-identical to master; the diff is the tag plus one commentclause.
Remaining timing failures by lane, 90 days
Signature: reference
95 / 1against stdout95 / 0, i.e. the bound returned 0. Excludes theflaky-check rows, which are one cluster on 2026-08-28 pre-dating the file's own
no-flaky-checktag,and the
NO_SUCH_DATA_PARTrows on this test, which are a different signature with its own owner.Stateless tests (arm_binary, parallel)Fast testFast testkeeps running the test after this change (p50 290 ms, max 1690 ms, none above 3000 ms).Locally the bound's own statistic moves from max 103 ms on an idle server to max 199 ms under 57
concurrent queries, with the result and
DistributedPlanLocalExecutionunchanged.Most recent report:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=117126&sha=1343529ab133f299e88306ccf7c009f235c5262c&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Workflow [PR]
Sync PR [sync-upstream/pr/117397]