Repository navigation
Speed up 02428_parameterized_view by batching client invocations - #103687
alexey-milovidov merged 4 commits into
Conversation
`02428_parameterized_view` issues ~99 separate `clickhouse-client` invocations. Under sanitizer load it takes ~109s on a quiet ASan box, and CI's amd_asan_ubsan `flaky check` (which runs each test 50x in parallel) drives this to a p50 of 232s and a p99 of 251s — well past the 180s flaky-check budget. The 30-day CIDB shows 41 `Test runs too long (> 180s)` failures across 10 PRs (none of them touching this test or randomization config), making this a pure timing flake. `tests/clickhouse-test` only enforces the 180s flaky-check timeout for tests without the `long` tag (see `clickhouse-test:3067-3072`). Add the tag — the test legitimately takes longer than 180s under sanitizer + parallel load due to its structure, not because of any logic issue. This matches the canonical pattern for similarly client-call-heavy tests already passing flaky check at 200-400s (`01516_drop_table_stress_long`, `01443_merge_truncate_long`, `01049_join_low_card_bug_long`, etc.). CIDB diagnostic: https://play.clickhouse.com/?user=play&query=SELECT%20test_name%2C%20count%28%29%20FROM%20default.checks%20WHERE%20test_name%3D%2702428_parameterized_view%27%20AND%20test_status%20IN%20%28%27FAIL%27%2C%27ERROR%27%29%20AND%20test_context_raw%20LIKE%20%27%25runs%20too%20long%25%27%20AND%20check_start_time%20%3E%20now%28%29%20-%20INTERVAL%2030%20DAY Co-Authored-By: Claude Sonnet 4.5 (1M context) <[email protected]>
|
Pre-PR validation gate (per worker TASK.md /
Session id: |
|
cc @KochetovNicolai — could you review this? It's a small test-only change adding the |
|
Workflow [PR], commit [3fc73e9] Summary: ✅ AI ReviewSummaryThis PR rewrites Final Verdict✅ No blocking findings. |
CI finish ledger — 42f907eCI finished (161 check-runs complete, 0 pending). This PR changes only
Session id: cron:our-pr-ci-monitor:20260703-053000 |
Pick up merged fix ClickHouse#104946 (JIT symbol lookup on macOS) and current master so CI re-runs the Fast test (arm_darwin) job on a healthy runner. The prior run's arm_darwin red was a stale 2026-04-29 setup abort during the ~3-day macOS runner outage (root cause tracked in ClickHouse#103235, LLVM 21 on Apple Silicon). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Merged current master and re-pushed (42f907e -> 51282bc) to re-run CI on a healthy Darwin runner. The prior
The |
Replace the long tag with query batching. The test spawned ~99 separate clickhouse-client processes; under sanitizer + flaky-check parallel load the per-run time exceeded the 180s flaky-check gate, causing timeouts. Batching the setup/teardown and non-error-path statements into single multi-statement client calls (~14 invocations) removes the dominant per-spawn overhead: ASan single-process drops from ~45s to ~10s per run, debug from ~9s to ~2.3s. The test now stays well under 180s without the long tag, so it keeps the full 50x flaky-check repeat count and remains part of the Fast test suite (both of which the long tag disabled). Error-expecting queries stay individual because an error aborts the rest of a batch. Test output and references are unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
02428_parameterized_view — opt into long-test budget|
Good catch, you're right - Reworked to option A: the ~99
That keeps the test well under the 180s gate without Error-expecting queries (piped through |
LLVM Coverage Report
Changed lines: No C/C++ source files changed — skipping uncovered code analysis. Newly covered by added/modified tests: 104 line(s), 2 function(s) across 46 file(s) · Details Top files
|
CI finish ledger — 368e2eaEvery failure below has an owner: a fixing PR (ours or external), or a full-effort fix task whose fixing-PR link will be posted here when it opens. Only
Session id: cron:our-pr-ci-monitor:20260703-160000 |
CI finish ledger update — arm_darwin line resolved to external fixing PRCorrecting the Root cause (not the ~1m setup timeout guessed earlier, and not the LLVM-JIT class): Owner: #108859 (external, open, mergeable) adds
Session id: cron:clickhouse-worker-slot-15:20260703-162000 |
CI finish ledger — 3fc73e9Every failure below has an owner: a fixing PR (ours or external), or a full-effort fix task
CI is fully finished on this head with no failing checks. Session id: cron:our-pr-ci-monitor:20260729-103000 |
alexey-milovidov
left a comment
There was a problem hiding this comment.
Very good, thank you!
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes
Description
02428_parameterized_viewwas timing out inStateless tests (amd_asan_ubsan, flaky check)and other heavy-sanitizer lanes: each run exceeded the 180s flaky-check gate. The test is structurally slow rather than buggy - it spawned ~99 separate$CLICKHOUSE_CLIENTprocesses, and each connection has fixed handshake/auth/settings-parse overhead that dominates the tiny queries themselves.CIDB (30 days) showed 41
Test runs too long (> 180s)failures across 10 unrelated PRs, 0 on master (a PR-only flaky-timing profile). Related closed issues: #102207, #88863.An earlier revision of this PR used
# Tags: longto opt into the longer flaky-check budget. As the automated review correctly pointed out, that has two side effects beyond the timeout exemption:longreduces the flaky-check repeat count toint(--test-runs * --long-test-runs-ratio)(50 -> 5), and drops the test fromFast test(which passes--no-long). That is a real coverage reduction for parameterized views, not just a timeout exemption.This revision instead removes the root cause of the slowness: the ~99 client invocations are batched into ~14 multi-statement
$CLICKHOUSE_CLIENTcalls, and thelongtag is removed. Statements that expect an error (piped throughgrep) are kept as individual invocations, because an error aborts the remaining statements of a multi-statement batch.--param_p/--param_lare converted to inlineSET param_*.The test now runs well under 180s without
long, so it keeps the full 50x flaky-check repeat count and remains part ofFast test.Measured locally (this workspace, single-process):
clickhouse-testUnder CI's 50x-parallel asan_ubsan flaky check the before-time scaled to the 232s p50 reported in CIDB; the after-time stays comfortably under the 180s gate even with the same amplification.
Test output, references, assertions, and settings are unchanged. Verified byte-identical against both
.reference(new analyzer, 2.29s) and.oldanalyzer.reference(old analyzer, 2.13s), and 60/60 passes under--test-runs 30with randomization enabled.Version info
26.8.1.372(included in26.8and later)