Skip to content

Split the TSan integration test jobs into eight batches - #120883

Merged
alexey-milovidov merged 4 commits into
ClickHouse:masterfrom
groeneai:groeneai/tsan-integration-eight-batches
Oct 11, 2026
Merged

alexey-milovidov merged 4 commits into
ClickHouse:masterfrom
groeneai:groeneai/tsan-integration-eight-batches

Conversation

@groeneai

@groeneai groeneai commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #118440
Related: #118933

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 required: this changes CI job geometry only.

Description

Integration tests (amd_tsan, N/6) runs the whole integration suite on AMD_MEDIUM with three
xdist workers against a two-hour pytest --session-timeout. Six batches leave no margin, so a
shard is cut mid-suite and reports ERROR: session-timeout occurred during test execution with
partial results and an unrun tail, where a real failure would be invisible.

The margin, measured on clean runs only (nothing failed), 30 days: the heaviest shard 5/6 has a
median of 92.4 minutes, 77% of the 120-minute budget, and about 350 clean jobs ran past 110 minutes.
Three jobs were cut with zero other failing tests: 3/6 twice, seven days apart (fb5cceef1329,
7c292497f75d), and 5/6 once (baab92b33c78). Every other Timeout row co-occurs with
test_storage_nats/test_nats_jet_stream.py failures; those jobs were red regardless, so I exclude
them from the count, and this change does not address them.

amd_tsan was the last full-suite integration flavor still on six batches, with ASan, MSan and
LLVM coverage all on eight on the same runner class. Raising the count rather than the timeout
keeps aggregate compute unchanged, since only the parallelism differs, and the job returns its
answer sooner.

Projected effect, by two independent methods that agree at 0.775 against 0.78: scoring
get_optimal_test_batch against measured per-module CIDB durations puts the heaviest shard at
73 minutes, 61% of budget, and that model reproduces the six observed shard medians to within 4%
(k = 1.008 +- 0.020), including which shard is heaviest; separately, the same-flavor 6-to-8 ratio
measured on the ASan arm after #118933 gives the same figure.

Cost: two more concurrent AMD_MEDIUM jobs per run, on four workflows. This reduces the exposure
rather than eliminating it, since amd_msan at eight batches still produced two Timeout rows in
30 days.

The second commit is the mechanical praktika yaml regeneration.


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

Version info

  • Merged into: 26.10.1.2093-master (included in 26.10 and later)

Integration tests (amd_tsan, N/6) runs the whole integration suite on
AMD_MEDIUM with three xdist workers against a two-hour pytest
--session-timeout (session_timeout_parallel = 7200s). Six batches leave no
margin: on runs where nothing failed at all, the heaviest shard (5/6) sits at
a median of 92.4 minutes, 77% of the 120-minute budget, and over 30 days 347
clean jobs across the six shards ran past 110 minutes. When ordinary per-tree
variance consumes the rest, xdist aborts the session and the job reports
"ERROR: session-timeout occurred during test execution" with partial results
and an unrun tail, so a real failure in that tail is invisible. Three jobs in
30 days were cut with zero other failing tests: 3/6 twice, seven days apart
(fb5ccee, 7c29249), and 5/6 once (baab92b). The remaining
Timeout rows on 2/6 co-occur with test_storage_nats/test_nats_jet_stream.py
failures and are a separate defect, not counted here.

Rather than raise the session timeout, raise the batch count, which is the
lever already applied to every other full-suite integration flavor: ASan
(ASAN_IT_NUM_BATCHES), MSan and LLVM coverage all run eight batches on the
same runner class, and amd_tsan was the last one still on six. The aggregate
compute is unchanged (same tests, two more per-batch setups) and the job
returns its answer sooner. Two independent estimates agree on the effect: the
same-flavor 6-to-8 ratio measured on the ASan arm (0.78 at p50/p90/p99) puts
the heaviest TSan shard at about 72 minutes, and repacking the ~529 minutes of
median per-tree work over eight batches at the observed packing spread puts it
at about 69 minutes, so roughly 58% of budget instead of 77%. That is the band
amd_msan already occupies at eight batches on the same runner class.

This reduces the exposure rather than eliminating it: amd_msan at eight
batches still produced two Timeout rows in 30 days. It also does not address
the 2/6 NATS failures, which are not a capacity problem.

No test is weakened or skipped.

Related: ClickHouse#118440
Mechanical output of `PYTHONPATH=./ci:. python3 -m praktika yaml` after the
previous commit. The four workflows that carry the arm rename their six
amd_tsan integration jobs to N/8 and gain two more; merge_queue.yml and
nightly.yml carry none and are unchanged.
@groeneai groeneai added can be tested Allows running workflows for external contributors groeneai-origin-request PR origin: a maintainer pinged or directed groeneai labels Sep 18, 2026
@groeneai

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

Pre-publication review by an independent model (engine: codex; 0 findings), plus my own cold
review of the resulting tree (3 nits, no blocker and no major). Nothing was bounced back.

# Sev Finding Verdict Evidence / action
1 💡 The count of clean jobs past 110 minutes is a sliding 30-day window and came out as 347, 345 and 349 on three measurements a few hours apart AGREE Published as "about 350" so the figure cannot be read as a reproducible constant. The first commit message carries the 347 snapshot
2 💡 "The other Timeout rows are on 2/6 and co-occur with 11 to 12 failures" is loose: 11 of the 12 are on 2/6, one is on 5/6, and the co-failure counts run 11, 12, 19 and 63 AGREE The substantive claim holds for all 12 rows, so the description was tightened to "every other Timeout row co-occurs with test_storage_nats/test_nats_jet_stream.py failures". The first commit message keeps the looser phrasing
3 💡 "keeps aggregate compute unchanged" understates by one clause: two extra per-batch setups add roughly 5% of runner-minutes AGREE, not blocking Disclosed in the description ("Cost: two more concurrent AMD_MEDIUM jobs per run") and in the commit message ("two more per-batch setups"), so no wording change

Severity: ❌ blocker / ⚠️ major / 💡 nit.

Checks I ran independently rather than taking from the change: every statistic in the description
reproduces on my own CIDB queries (heaviest shard median 92.6 against the stated 92.4, ASan 6-to-8
p50 ratio 0.783 against 0.78, exactly three Timeout rows with zero co-failing tests and they are
the three commits named, amd_msan at eight batches exactly two rows); the regenerated YAML is
complete and confined (8 job blocks in exactly the 4 workflows that carry the arm, zero surviving
6-batch references, finish_workflow and promql_compliance dependency lists updated to eight,
every cache key decoding to its own job name, and no line of unrelated churn); no other carrier
needs an edit, since the batch number is parsed and packed generically and the one positional index
into the job list resolves the name dynamically; and the projection is not assuming an impossible
packing, since the heaviest indivisible unit the partitioner works with is 38.6 minutes of
wall-equivalent against a 66-minute bin at eight batches.

Session id: cron:clickhouse-review-slot-11:20260918-163500

@clickhouse-gh clickhouse-gh Bot closed this Sep 18, 2026
@groeneai

Copy link
Copy Markdown
Collaborator Author
Pre-PR validation gate (click to expand)
# Question Answer
a Deterministic repro? No local repro is possible: it would mean running the full integration suite for two hours on a 16-cpu/48-GB runner shape, eight times. Instead the packing model prescribed for this decision in ci/defs/defs.py is validated against reality (see e), and the field evidence is three CI overruns with zero other failing tests, two of them on the 3/6 shard seven days apart.
b Root cause explained? Yes. Six batches put the heaviest shard at a 92.4-minute median, 77% of the 120-minute pytest --session-timeout budget, on runs where nothing failed; ordinary per-tree variance then crosses 7200 s, xdist aborts the session, and the job reports partial results with an unrun tail.
c Fix matches root cause? Yes. The defect is capacity and the fix adds capacity on the axis already used by every other flavor. No timeout raised, no test skipped or muted, no bound widened. Raising the session timeout was considered and rejected on the record in #118384.
d Test intent preserved / new tests added? Preserved exactly: the same 1174 test files run, redistributed over eight shards instead of six. Nothing is skipped, tagged or weakened. No test file is added: nothing in the repository runs a suite that could assert CI job geometry.
e Both directions demonstrated? Yes. The workflow geometry check reads /6=6, /8=0 before the change and /6=0, /8=8 after, in all four affected workflows and in neither of the two unaffected ones; re-running the generator after the regeneration commit leaves git diff-index empty, which is the assertion CI itself makes. Effect direction: heaviest shard 92.4 to 73 minutes, from a model that reproduces all six observed shard medians to within 4% (k = 1.008 +- 0.020) and picks the same heaviest shard.
f Fix is general across code paths? Yes. The four generated workflows are regenerated; ci/workflows/pull_request.py only indexes the list and resolves the job name dynamically; get_optimal_test_batch is fully parameterized and already runs at eight batches on three other flavors; TSan uses one artifact for all batches, so there is no artifact-count coupling. amd_tsan was the last full-suite integration flavor on six.
g Fix generalizes across inputs (params/datatypes/wrappers)? Not a data-path change, so no type or wrapper matrix applies. The analogous axis is geometry: the count feeds a partitioner that validates batch_num <= total_batches, is deterministic by construction, and conserves the file set at both six and eight batches (asserted). All batch numbers 1 to 8 are generated in all four workflows.
h Backward compatible? (maintainer-approved exception only) Nothing at stake: no setting, no SettingsChangesHistory.cpp, no serialization, no user-visible behavior, zero src/ files touched. Job names change from N/6 to N/8, which is inherent to any batch change and how the previous ones landed; nothing outside the generated YAML hardcodes them. Release and backport branches pick the split up automatically, as intended.
i Invariants and contracts preserved? Yes. Every test still runs exactly once (file conservation asserted at both geometries, 1174 = 1174). The generator/YAML consistency contract holds (git diff-index empty on re-run). The partitioner's own contract is untouched. The required-job selectors are unaffected, since this set is the non-required one.

Session id: cron:clickhouse-impl-slot-6:20260918-162000

@clickhouse-gh clickhouse-gh Bot reopened this Sep 18, 2026
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Sep 18, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [dc0e5ef]

Summary: ✅


AI Review

Summary

This PR changes the non-required full-suite amd_tsan integration configuration from six shards to eight and regenerates the three workflows that consume that job list. I did not find any correctness or wiring gaps: the source-of-truth change propagates to every affected workflow, the new 7/8 and 8/8 jobs are present everywhere they should be, finish_workflow depends on the renamed jobs, and rerunning PYTHONPATH=./ci:. python3 -m praktika yaml reproduces the checked-in YAML cleanly.

Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Sep 18, 2026
@groeneai
groeneai requested review from leshikus and maxknv September 18, 2026 17:12
@clickhouse-gh clickhouse-gh Bot added the comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). label Sep 18, 2026
@leshikus

Copy link
Copy Markdown
Collaborator

already approved by @maxknv, removed myself

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Oct 10, 2026
@alexey-milovidov alexey-milovidov self-assigned this Oct 10, 2026
Merged via the queue into ClickHouse:master with commit e4f5ef8 Oct 11, 2026
163 checks passed
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 11, 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 comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). groeneai-origin-request PR origin: a maintainer pinged or directed groeneai manual approve Manual approve required to run CI 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.

5 participants