Skip to content

Mark flaky 02932_refreshable_materialized_views_2 as long - #105156

Merged
alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/fix-02932-refreshable-mv2-long-tag
May 17, 2026
Merged

alexey-milovidov merged 1 commit into
ClickHouse:masterfrom
groeneai:groeneai/fix-02932-refreshable-mv2-long-tag

Conversation

@groeneai

@groeneai groeneai commented May 17, 2026 •

Copy link
Copy Markdown
Collaborator

Marks the stateless test 02932_refreshable_materialized_views_2.sh with the long tag so the Fast test job (which is invoked with --no-long in ci/jobs/fast_test.py) stops running it. The test still runs on every other stateless test configuration.

The test exercises ~10 SYSTEM WAIT VIEW calls, multiple REFRESH EVERY 1 SECOND materialized views with sleepEachRow(1) source data, and ~11 polling loops that each spawn a fresh clickhouse-client. CIDB shows it passes 99% of Fast test runs (median 13s, p99 18s, max-passing 48s) but the remaining ~1% spike past the 60s per-test timeout under CI load and get killed at process-group level — typically on the first system wait view e; after creating a REFRESH EVERY 1 SECOND view. Over the last 30 days: 30 Fast test failures across 27 distinct PRs; 0 failures on head_ref = 'master'; the test passes 500+ times on every non-Fast test job configuration we ran.

Other stateless test jobs are unaffected — amd_debug, parallel, amd_tsan, parallel, amd_msan, WasmEdge, amd_asan_ubsan, distributed plan, arm_binary, arm_asan_ubsan, azure, amd_llvm_coverage, and the various flaky check variants all still cover this test.

Issue: closes #97651 (auto-generated flaky test issue for this test name).
Reported on PR #100539 by @alexey-milovidov.
Representative failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100539&sha=ca588ac6d6dad5bfd61156a014a09e928cea8ed4&name_0=PR&name_1=Fast%20test

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

Not for changelog.

Documentation entry for user-facing changes

  • Documentation is unchanged (CI-only test classification).

Version info

  • Merged into: 26.5.1.721

This stateless test is fundamentally too heavy for the `Fast test` job's
60-second per-test budget. It exercises ~10 `SYSTEM WAIT VIEW` calls,
multiple `REFRESH EVERY 1 SECOND` materialized views with `sleepEachRow(1)`
source data, and ~11 polling loops, each of which spawns a fresh
`clickhouse-client` process.

CIDB shows the test passes 99% of `Fast test` runs (median 13s, p99 18s,
max passing 48s) but the remaining ~1% spike past the 60s timeout under
CI load and are killed at process-group level. The killed call site is
typically the first `system wait view e;` after creating a `REFRESH
EVERY 1 SECOND` view, where CI load delays scheduler progress past the
budget.

Recent timeline (chronic, not a regression):
  30 days, `Fast test` job alone: 30 failures across 27 distinct PRs.
  0 master failures with `head_ref = 'master'` (the 3 nominal master
  failures were `gh-readonly-queue/master/pr-*` merge-queue runs that
  also exercised `Fast test`).

The `long` tag keeps this test out of `Fast test` (which is invoked
with `--no-long` in `ci/jobs/fast_test.py`) while preserving coverage
on all other stateless test configurations — including
`amd_debug, parallel`, `amd_tsan, parallel`, `amd_msan, WasmEdge`,
`amd_asan_ubsan, distributed plan`, `arm_binary`, `arm_asan_ubsan, azure`,
`amd_llvm_coverage` and the various flaky-check variants. Each of these
saw 500+ passing runs in 30 days with zero failures, so coverage on the
actual test is not affected.

A representative failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100539&sha=ca588ac6d6dad5bfd61156a014a09e928cea8ed4&name_0=PR&name_1=Fast%20test
(failure raised on ClickHouse#100539 by @alexey-milovidov)

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@groeneai

Copy link
Copy Markdown
Collaborator Author

Pre-PR validation gate (session cron:clickhouse-ci-task-worker:20260517-133000):

a) Deterministic repro? Yes — the test runner's tag parser is deterministic. clickhouse-test --no-long reads the Tags: line and skips this test exactly when long appears. Mechanically reproduced locally on the modified file: tags parse as ['atomic-database', 'memory-engine', 'long'] → --no-long skip decision = NO_LONG. Sibling _1 (no long tag) remains unaffected.

b) Root cause explained? The test exercises ~10 SYSTEM WAIT VIEW calls + ~11 polling loops + multiple REFRESH EVERY 1 SECOND materialized views over sleepEachRow(1) sources. Median wall time on Fast test is 13s and p99 is 18s, but tail-load variance regularly pushes individual runs past the 60s per-test budget set by ci/jobs/fast_test.py (--timeout 60). When that happens the test runner kills the entire process group at exactly 60s — typically on system wait view e; (line 45) where the refresh scheduler is the only piece of code with non-trivial timing assumptions.

c) Fix matches root cause? Yes. The mechanism is a budget mismatch between an intrinsically long comprehensive feature test and a 60-second quick-sanity-check job. The long tag is the standard ClickHouse marker for tests that exceed quick budgets, and --no-long is the established skip path in Fast test. No widening of bounds, no weakening of assertions, no removal of test logic.

d) Test intent preserved? Yes. The test logic is byte-identical. Coverage is preserved on every other stateless test configuration — amd_debug, parallel (564 passes/30d), amd_tsan, parallel (565), amd_msan, WasmEdge (563), amd_asan_ubsan, distributed plan (564), arm_binary (565), arm_asan_ubsan, azure (560), amd_llvm_coverage, * (596+), and every flaky-check variant. Each saw zero failures over the last 30 days, so the test's coverage continues unimpeded everywhere it's well-budgeted.

e) Both directions demonstrated? Yes. WITHOUT the tag: 30 Fast test failures across 27 distinct PRs in 30 days (CIDB). WITH the tag: the test runner's parse + skip-decision was reproduced above; Fast test no longer schedules this test, so it cannot time out there.

f) Fix is general? N/A — this is a test classification change, not a code change. No bug class is being patched, so the "does the same bug exist elsewhere" question doesn't apply. Sibling test 02932_refreshable_materialized_views_1 is also a heavy refreshable-MV test but its Fast test failure rate (4/5663 = 0.07%) is an order of magnitude lower, so applying the same change to it is not justified at this time.

@groeneai

Copy link
Copy Markdown
Collaborator Author

cc @al13n321 — could you review this? Test-only change: adds the long tag to keep 02932_refreshable_materialized_views_2.sh out of the 60s-budget Fast test job; coverage on every other stateless test job is preserved. Filed in response to @alexey-milovidov's directive on #100539.

@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label May 17, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [d9d3a22]

Summary: ✅


AI Review

Summary

This PR reclassifies 02932_refreshable_materialized_views_2.sh as a long test and documents why, so Fast test (which runs with --no-long) no longer executes a known timeout-prone case while preserving the test logic itself. The change is narrowly scoped to test tagging/comments, aligns with the stated CI-stability goal, and I did not find correctness, safety, or contract issues in the current diff.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label May 17, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue May 17, 2026
@alexey-milovidov alexey-milovidov self-assigned this May 17, 2026
Merged via the queue into ClickHouse:master with commit eb8ba76 May 17, 2026
167 checks passed
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label May 17, 2026
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 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.

Flaky test: 02932_refreshable_materialized_views_2

3 participants