Repository navigation
Faster and cheaper PR CI: earlier stage 2, shorter tail, cross-compiled builds in the merge queue - #131576
Merged
Conversation
The job is in `CORE_BLOCKING_JOB_NAMES` of the PR workflow, so stage 2 (about 145 jobs) waits for it. Its sequential tests take about 48 minutes in total, so it ended about 25 minutes after the rest of the gate on most PR runs. With two hash batches each one takes about 24 minutes of tests, in line with the other gate jobs. Example: https://github.com/ClickHouse/ClickHouse/actions/runs/43497656163 (PR #131389)
Contributor
|
Workflow [PR], commit [457109b] Summary: ✅ AI ReviewSummaryReviewed PR #131576 at Final Verdict✅ Approve. No required changes or new inline comments. |
`amd_darwin`, `arm_v80compat`, `amd_freebsd`, `amd_illumos`, `ppc64le`, `amd_compat`, `amd_musl`, `riscv64`, `s390x` and `loongarch64` ran on every PR commit (about 2260 a week, about $2.4 per commit together) but were the only failing build in 25 PRs over 2026-09-15 to 2026-11-14. The merge queue runs about 850 times a week, so it catches the same breakages before they reach master for about a third of the cost. They need only the source, so in the queue they start right away and end before the flaky check. Master still builds them on every commit. In the queue they only check that the code compiles: no artifacts, and no post hooks, because without a PR number `build_master_head_hook.py` would publish the binaries as the master ones and `build_profile_hook.py` would record a master baseline. `Build (arm_darwin)` stays in pull requests because `Fast test (arm_darwin)` needs its binary, as do `Build (wasm64)` and `Build (arm_fuzzers)`, which catch breakages more often.
Stateless tests (arm_binary, sequential) into two batchesarm_binary, sequential in two, move 10 cross-compiled builds to the merge queue
`Integration tests (amd_asan_ubsan, db disk, targeted)` selects tests by the coverage of the changed lines, so its duration grows with the PR: p50 41 min, p90 120 min, and on 30% of PR commits it ran 90 minutes or more. As a gate job it held back stage 2 on large PRs by up to an hour. It still starts right after its build and stays required. Modelled on the latest full run of each of 100 PRs (2026-11-13..2026-11-14), stage 2 would start at p50/p75/p90 59.9/65.0/81.7 minutes, against 64.5/128.7/156.7 with only the `arm_binary, sequential` split, and 80.9/128.7/156.7 before. It was the only failing gate job on 99 of 4646 PR commits (2.1%) over 14 days, which would now run stage 2 (about $30 each, about $1.4k a week).
arm_binary, sequential in two, move 10 cross-compiled builds to the merge queue…, 5 integration shards, 4 workers - `SQLLogic test` and `SQLStorm test` move from the PR workflow to `NightlySQLancer` (master keeps them). Over 30 days 1 of 5169 PR commits failed `SQLLogic test` and none of 5458 failed `SQLStorm test`; `SQLLogic test` took 92 minutes and ended the PR run in a quarter of the runs. - PRs run `Stateless tests (arm_asan_ubsan, azure, targeted)` instead of the full azure suite (master keeps it). Its PR failure rate equalled master's (1.55% vs 1.79% parallel, 0.76% vs 0.61% sequential), and at 85-100 minutes it ended a sixth of the PR runs. - `Integration tests (arm_binary)` is split into 5 batches instead of 4: a batch took about 93 minutes and ended a third of the PR runs. - Integration jobs use 4 CPUs per pytest worker instead of 5, so the 16-vCPU runners run 4 workers instead of 3. Their 48 GiB nested budget gives each worker 12 GiB, above the 11 GiB model; the `--dist=each` flaky check stays at 2 workers, limited by memory.
fm4v
enabled auto-merge
November 14, 2026 10:29
This was referenced Nov 14, 2026
opensource-fork-sync Bot
pushed a commit
to cla7aye15I4nd/opensource-ClickHouse__ClickHouse
that referenced
this pull request
Nov 15, 2026
The new `Stateless tests (arm_asan_ubsan, azure, targeted)` job (ClickHouse#131576) runs the test 50 times on one server with fixed settings. `query_23` (`... WHERE URL LIKE '%google%' ORDER BY EventTime LIMIT 10`) is a TopK read: with the default `use_query_condition_cache = 1` every run stores the granules the TopK filter dropped, and the next run starts from them. The selection shrinks run over run (CI: 383, 26, 16, 9 marks), `ReadCompressedBytes` falls more slowly than the estimate, and the ratio crosses the test's 2x bound once it converges (2.005x / 2.022x on ClickHouse#109377 and ClickHouse#129198). Randomized jobs never converge because the cache and TopK settings are re-drawn per run. Pin `use_query_condition_cache=0` test-wide, as the sibling estimation tests 03801 and 04102 already do; the cache with autopr stays covered by 03783_autopr_dataflow_cache_reuse_qcc. Locally, unpatched at CI's thread count: red from run 4-5 (8-9 marks, 2.02-2.04x); patched: 10/10 with a constant 1084 marks, and 50/50 with random settings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the public PR workflow finish sooner and costs less, without dropping the gate that keeps broken PRs from spending stage-2 runners.
Estimated effect, modelled on the latest full run of each of 100 PRs (2026-11-13..2026-11-14, GitHub jobs API), minutes from the run start:
Changes:
Stateless tests (arm_binary, sequential)is split into two batches.Integration tests (amd_asan_ubsan, db disk, targeted)is no longer part ofCORE_BLOCKING_JOB_NAMES; it still starts right after its build and stays required.Integration tests (arm_binary)runs in 5 batches instead of 4, and integration jobs run 4 pytest workers instead of 3.Stateless tests (arm_asan_ubsan, azure, targeted)instead of the full azure suite (master keeps it).SQLLogic testandSQLStorm testmove from the PR workflow toNightlySQLancer(master keeps them).Cost per week at ~2260 PR commits: about -$5.5k (azure suite), -$3.4k (cross builds), -$1.3k (SQL suites), +$1.4k (stage 2 now also runs on the 2.1% of commits that failed only the ASan integration job), plus small setup costs of the extra batches.
1. Split
Stateless tests (arm_binary, sequential)Stage 2 (about 145 jobs) waits for
CORE_BLOCKING_JOB_NAMES, and this was its slowest job: 1231 sequential tests, 47.9 minutes in total, ending about 25 minutes after the rest of the gate. Gate jobs, public CIDB, PR runs from 2026-11-07 to 2026-11-14:Stateless tests (arm_binary, sequential)Integration tests (amd_asan_ubsan, db disk, targeted)Stateless tests (amd_asan_ubsan, db disk, distributed plan, targeted)Unit tests (tsan)Stateless tests (amd_debug, parallel)Stateless tests (arm_binary, parallel)With
crc32(file) % 2(as inclickhouse-test --run-by-hash-*) the batches hold 24.4 and 23.5 minutes of tests, about 30 minutes per job with setup. The extrapr-arm-smalljob costs about $0.03 per commit. Dropping the lane from the gate instead would have cost about 20x more: it was the only failing gate job on 2.1% of PR commits, each of which would then run stage 2 (about $30).Example of the delay: run https://github.com/ClickHouse/ClickHouse/actions/runs/43497656163 of PR #131389 created 139 stage-2 jobs at minute 76, while the other gate jobs had ended by minute 56.
2. Do not gate on
Integration tests (amd_asan_ubsan, db disk, targeted)Its coverage-based selection grows with the PR: on 30% of PR commits it ran 90 minutes or more (median 78 modules). After change 1 it is the last gate job in 46 of 100 runs; large PRs, which are also the only ones that run the stress, fuzzer and SQL jobs, started stage 2 at 125-150 minutes. Over 14 days it was the only failing gate job on 99 of 4646 PR commits (2.1%). Stage 2 has integration jobs of its own (the full
arm_binaryrun and theamd_tsan,amd_msanandarm_binarytargeted ones), so a PR that breaks integration tests still fails early. Sharding it was rejected: the targeted path would need batching, every shard would repeat the CIDB selection, and large selections would still take 40-55 minutes.3-5. The slowest stage-2 jobs
After changes 1-2 the run would still end at 163 / 175 / 197 minutes (p50 / p75 / p90). The jobs that ended it:
Integration tests (arm_binary)SQLLogic testNightlySQLancerStateless tests (arm_asan_ubsan, azure, parallel)worker_plangave min(16 // 5, 48 // 11) = 3 workers, limited by CPU. WithMAX_CPUS_PER_WORKER = 4it is 4 workers at 12 GiB each (the model is 11 GiB). The--dist=eachflaky check stays at 2 workers, limited by memory.allow_failure), so the full run found nothing specific to the PRs, at about $2.9 per PR commit. The targeted job runs the changed tests, the tests covering the changed lines and the previously failed ones, like the other sanitizer configurations.SQLLogic testand none of 5458 failedSQLStorm test.6. Cross-compiled builds to the merge queue
amd_darwin,arm_v80compat,amd_freebsd,amd_illumos,ppc64le,amd_compat,amd_musl,riscv64,s390xandloongarch64cost about $2.4 per PR commit together. PRs in which the build was the only failing build, 2026-09-15 to 2026-11-14 (about 18,600 PR commits):ppc64leamd_freebsdamd_compat,s390x,amd_illumosamd_darwin,amd_musl,riscv64,loongarch64arm_v80compatThe merge queue runs about 850 times a week, so it still stops these breakages before master at about a third of the cost. The builds need only the source and take 6-9 minutes, so they end long before
Stateless tests (amd_binary, flaky check)(p50 24 minutes) and add no queue latency. In the queue they only compile: no artifacts (nothing there uses them) and no post hooks, because without a PR numberbuild_master_head_hook.pywould publish the binaries as the master ones andbuild_profile_hook.pywould record a master baseline. Kept in PRs:Build (arm_darwin)(needed byFast test (arm_darwin)),Build (wasm64)(14 PRs) andBuild (arm_fuzzers)(66 PRs).Related: #131389
Changelog category (leave one):
Version info
26.11.1.2311-master(included in26.11and later)