Skip to content

Keep the finished-stages drain test away from the parallel suite - #117397

Merged
PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:05047-no-parallel
Sep 1, 2026
Merged

PedroTadim merged 1 commit into
ClickHouse:masterfrom
groeneai:05047-no-parallel

Conversation

@groeneai

@groeneai groeneai commented Aug 31, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #116987

05047_distributed_plan_finished_stages_drain closes with a wall-clock bound,
max(query_duration_ms) < 3000. The regression it catches costs a fixed ~4 seconds regardless of
hardware (stage_poll_interval_ms = 100 in ReadFromDistributedPlanSource.h times ~40 stages), so an
absolute bound fits. But the parallel job passes --no-sequential and runs the rest of the suite
against 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 on Fast test. Two of the four are other
contributors' pull requests; the other two are mine, both after #116987 merged with its change present.

no-parallel moves the test into the matching sequential job rather than skipping it, so the
assertion keeps running. I read the tag as strictly necessary in the sense AGENTS.md asks for: the
test is already parallel-safe the usual way (currentDatabase()-scoped, no file I/O), so unique naming
is 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, parallel against 1.47 on arm_binary, sequential. This test has
never run on a sequential job, so that lane holds no history for it; the closest in-tree reference is
01360_materialized_view_with_join_on_query_log, which also asserts query_duration_ms under
no-parallel: 27258 runs there in 90 days, 0 failures.

Oracle, bound, query and .reference are byte-identical to master; the diff is the tag plus one comment
clause.

Remaining timing failures by lane, 90 days

Signature: reference 95 / 1 against stdout 95 / 0, i.e. the bound returned 0. Excludes the
flaky-check rows, which are one cluster on 2026-08-28 pre-dating the file's own no-flaky-check tag,
and the NO_SUCH_DATA_PART rows on this test, which are a different signature with its own owner.

check runs timing failures on master first last
Stateless tests (arm_binary, parallel) 3254 4 0 2026-08-28 22:08:20 2026-08-31 15:29:46
Fast test 1696 0 0 - -

Fast test keeps 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 DistributedPlanLocalExecution unchanged.

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):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

...


Workflow [PR]
Sync PR [sync-upstream/pr/117397]

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.
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding labels Aug 31, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Internal second-model review (click to expand)

I reviewed this cold before reading my own implementation notes, then had an independent model
re-review the diff. The gate returned zero findings on the change itself. What I did find was all
in the description, and it is corrected above rather than left for a reviewer to catch.

Finding Verdict
❌ The description said three of the four remaining failures were other contributors' pull requests. Two are; the other two are mine. It was also impossible as arithmetic, splitting four rows into 2 + 3 with no overlap. Agreed. Counts re-measured from CIDB and authorship checked per PR. Corrected before publishing.
⚠️ It reported "none on any sequential arm" as though that were a clean result for the lane this change moves the test to. The test has never been selected by a sequential job, so that figure could only ever be zero. Agreed. The description now says that lane holds no history, and cites 01360_materialized_view_with_join_on_query_log instead: the same kind of query_duration_ms assertion under no-parallel, 27258 runs on that lane in 90 days, 0 failures.
⚠️ AGENTS.md asks that no-* tags not be added unless strictly necessary and names no-parallel. The description answered the general objection to the tag but not that rule. Agreed. The necessity argument is now made against the rule directly.
💡 The commit message repeats the same "none on any sequential arm" clause. Noted, not blocking. True but uninformative, and amending it would mean another round for a wording change.

Two things I checked myself and could not fault. The destination job is real rather than assumed:
arm_binary, sequential is the only sequential lane this file's six existing exclusions leave
standing, so the assertion keeps running there, and Fast test is unaffected by the tag either way.
And that lane runs on a smaller instance, so I expected the bound's margin to shrink; measured per
test over 14 days it does not, because the baseline rises about 15% while the tail falls roughly
fourfold.

The signature-A census in the description holds only once the NO_SUCH_DATA_PART failures on this
test are separated out. Those are a different signature, they are the ones that reach master, and they
are tracked separately from this change.

@clickhouse-gh

clickhouse-gh Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d314482]

Summary: ✅


AI Review

Summary

This PR moves 05047_distributed_plan_finished_stages_drain out of the parallel stateless-test flavor by adding no-parallel to a wall-clock-bound regression test. I checked the current diff, the PR description, prior discussion, and the functional-test selection logic; no-parallel routes the test to the independently scheduled sequential flavor instead of dropping it, and the PR workflow still treats a _binary, sequential functional-test lane as merge-blocking. I did not find a correctness, coverage, or metadata issue that warrants a review comment.

Final Verdict

Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 31, 2026
@PedroTadim PedroTadim self-assigned this Sep 1, 2026
@PedroTadim
PedroTadim added this pull request to the merge queue Sep 1, 2026
Merged via the queue into ClickHouse:master with commit 7131e17 Sep 1, 2026
174 of 175 checks passed
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 1, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Sep 2, 2026
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors groeneai-origin-ci-master PR origin: master/nightly CI monitoring finding pr-ci pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants