Skip to content

Split the ASan integration test jobs into eight batches - #118933

Merged
alexey-milovidov merged 2 commits into
masterfrom
ci-integration-old-analyzer-8-batches
Sep 12, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
ci-integration-old-analyzer-8-batches

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6) reported Timeout on master with xdist.dsession.Interrupted: session-timeout: 7200.0 sec exceeded after 974 passed, 10 skipped ... in 7360.29s. Nothing failed and nothing hung — the longest quiet gap in the whole run was 136 s. The batch simply held more work than the two-hour pytest --session-timeout allows, and was cut off with 20 of its 1004 modules still to go.

This is chronic rather than a one-off: over the last three weeks the six old-analyzer batches reported Timeout 133 times between them, on every one of the six. The job is required on every pull request, on master and on backport branches, so each occurrence is a red required check on an unrelated change.

The cause is capacity, not balance. The integration suite measures about 112000 test-seconds; six batches of three xdist workers can absorb at most 129600, so the packing runs at 86% of budget on average and the heaviest shard lands at 119.7 of the 120 available minutes. Scoring get_optimal_test_batch over the 1139 modules actually in tests/integration/, weighted by per-module sum(test_duration_ms) measured on the failing commit itself, reproduces the failure exactly — batch 5 of 6, the batch that timed out, is the heaviest:

batches per-shard wall (min) heaviest shard % of budget spread max/min
6 (before) 102.9 96.6 104.7 96.8 119.7 99.1 119.7 min 100% 1.240
8 (after) 75.2 77.1 75.1 79.5 75.7 78.0 77.0 82.1 82.1 min 68% 1.094

Batches are the right lever rather than a longer timeout. Aggregate compute is unchanged, because the work is the same and only the parallelism differs, so the only cost is one more per-batch setup (about 3 minutes) — and the job returns its answer 25% sooner than it does today.

Both ASan flavors move together. integration_test_asan_master_jobs (amd_asan_ubsan, db disk, release branches) runs the same suite with the same worker count against the same budget and sits at the same 96–103 minutes per shard, so the measurement that rules out six for one rules it out for the other; it has simply had far fewer runs in which to show it since #116591 took it from four to six. The shared count now lives in ASAN_IT_NUM_BATCHES so the two cannot drift apart. CORE_BLOCKING_JOB_NAMES selects these jobs by substring, so the blocking gate picks up all eight batches with no change.

Noted while measuring, and deliberately not changed here: TEST_DURATIONS in ci/jobs/scripts/integration_tests_configs.py sums to about 97000 test-seconds against a measured 112000, so the packer reports every shard as evenly packed — it printed weights of [5384, 5384, 5384, 5384, 5384, 5383] for the run whose real shards ranged over 97 to 120 minutes. Refreshing that table is separate periodic maintenance (it is documented as such, and it repacks every integration flavor at once), so it belongs in its own change. Eight batches hold with the table as it is.

CI report: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=417aa9966eed1467f418da9b4deae15ef020c5f3&name_0=MasterCI&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%205%2F6%29

Related: #116591
Related: #115963

Changelog category (leave one):

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

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

Version info

  • Merged into: 26.9.1.1282 (included in 26.9 and later)
  • Backported to: 26.8.5.14, 26.7.9.15, 26.6.7.21, 26.3.33.88

`Integration tests (amd_asan_ubsan, db disk, old analyzer, 5/6)` reported
`Timeout` on master with `xdist.dsession.Interrupted: session-timeout: 7200.0
sec exceeded` after `974 passed, 10 skipped ... in 7360.29s`. Nothing failed
and nothing hung - the longest quiet gap in the whole run was 136 s - the batch
simply held more work than the two-hour pytest `--session-timeout` allows, and
was cut off with 20 of its 1004 modules still to go.

This is chronic rather than a one-off. Over the last three weeks the six
old-analyzer batches reported `Timeout` 133 times between them, on every one of
the six. The job is required on every pull request, on master and on backport
branches, so each occurrence is a red required check on an unrelated change.

The cause is capacity, not balance. The integration suite measures about 112000
test-seconds; six batches of three xdist workers can absorb at most 129600, so
the packing runs at 86% of the budget on average and the heaviest shard lands at
119.7 of the 120 available minutes. Scoring `get_optimal_test_batch` over the
1139 modules actually in `tests/integration/`, weighted by per-module
`sum(test_duration_ms)` measured on the failing commit itself, reproduces the
failure exactly: batch 5 of 6 - the batch that timed out - is the heaviest, at
100% of budget. At eight batches the heaviest shard is 82 minutes, 68% of the
budget, and the measured spread across shards narrows from 1.24 to 1.09.

Batches are the right lever rather than a longer timeout. Aggregate compute is
unchanged, because the work is the same and only the parallelism differs, so the
only cost is one more per-batch setup (about 3 minutes) - and the job returns its
answer 25% sooner than it does today.

Both ASan flavors move together. `integration_test_asan_master_jobs`
(`amd_asan_ubsan, db disk`, release branches) runs the same suite with the same
worker count against the same budget and sits at the same 96-103 minutes per
shard, so the measurement that rules out six for one rules it out for the other;
it has simply had far fewer runs in which to show it since #116591 took it from
four to six. The shared count now lives in `ASAN_IT_NUM_BATCHES` so the two
cannot drift apart.

`CORE_BLOCKING_JOB_NAMES` selects these jobs by substring, so the blocking gate
picks up all eight batches with no change.

While measuring this: `TEST_DURATIONS` in
`ci/jobs/scripts/integration_tests_configs.py` sums to about 97000 test-seconds
against a measured 112000, so the packer reports every shard as evenly packed
(printing weights of `[5384, 5384, 5384, 5384, 5384, 5383]` for a run whose real
shards ranged over 97 to 120 minutes). Refreshing that table is separate
periodic maintenance - it is documented as such, and it repacks every
integration flavor at once - so it is left for its own change. Eight batches
hold with the table as it is.

CI report:
https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=417aa9966eed1467f418da9b4deae15ef020c5f3&name_0=MasterCI&name_1=Integration%20tests%20%28amd_asan_ubsan%2C%20db%20disk%2C%20old%20analyzer%2C%205%2F6%29

Related: #116591
Related: #115963

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3377d59]

Summary: ✅


AI Review

Summary

This PR centralizes the ASan integration-test shard count in ASAN_IT_NUM_BATCHES and regenerates the PR, MasterCI, BackportPR, and ReleaseBranchCI workflows so the affected amd_asan_ubsan integration suites run as 1/8 through 8/8 everywhere. I did not find a correctness or workflow-wiring regression in the current diff.

Missing context / blind spots
  • ⚠️ PR CI only exercised Config Workflow and Style check; every renamed integration shard was skipped by the changed-files filter, so the eight-shard runtime improvement itself is not exercised on this PR head.
Final Verdict

✅ No blocking issues found.

@clickhouse-gh clickhouse-gh Bot added pr-ci comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). labels Sep 9, 2026
@Algunenano Algunenano self-assigned this Sep 9, 2026

@Algunenano Algunenano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but we should also consider making some tests faster, removing unnecessary ones, or transforming them to stateless tests when possible. Otherwise the problem keeps getting larger and larger

Conflicts in the generated `.github/workflows/master.yml` and
`.github/workflows/pull_request.yml` were resolved by taking master's
generated files and regenerating them from the merged `ci/defs` with
`python3 -m ci.praktika yaml`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 CH Inc sync was red for a reason worth recording here: the private sync PR was CONFLICTING, and the conflict was in ci/defs/job_configs.py — private master carries its own, never-upstreamed commit "Increase amd_asan_ubsan db disk integration tests to 7 batches" (2026-06-03) that hand-set both ASan integration flavors to 7. So the private side had already reached the same conclusion as this PR, one batch short of it.

I resolved the conflict in favour of this PR's ASAN_IT_NUM_BATCHES, so the private repo moves 7 -> 8 along with the public one; the private-only AMD_MEDIUM_MEM runner label on those jobs is preserved. That also required bumping JOBS_IN_SYNC_CNT from 23 to 24 in the private ci/workflows/private_pull_request.py (the extra old-analyzer shard is part of the sync job set, and praktika yaml refuses to generate until the assertion matches) and regenerating the private workflow YAMLs.

The sync PR is MERGEABLE again and its Config Workflow is green, so the check should settle once the private suite finishes. Nothing changed on the public side of this PR.

@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Sep 12, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

LGTM, but we should also consider making some tests faster, removing unnecessary ones, or transforming them to stateless tests when possible. Otherwise the problem keeps getting larger and larger

Yes, recently we've added many tests for unimportant, irrelevant corner cases, where the case does not justify the complexity of the test. We can do a pass of finding and trimming them.

Merged via the queue into master with commit 81bd8c6 Sep 12, 2026
177 checks passed
@alexey-milovidov
alexey-milovidov deleted the ci-integration-old-analyzer-8-batches branch September 12, 2026 17:02
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Sep 12, 2026
@maxknv maxknv added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Sep 15, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Sep 15, 2026
PedroTadim added a commit that referenced this pull request Sep 15, 2026
Cherry pick #118933 to 26.6: Split the ASan integration test jobs into eight batches
PedroTadim added a commit that referenced this pull request Sep 15, 2026
Cherry pick #118933 to 26.7: Split the ASan integration test jobs into eight batches
PedroTadim added a commit that referenced this pull request Sep 15, 2026
Cherry pick #118933 to 26.8: Split the ASan integration test jobs into eight batches
PedroTadim added a commit that referenced this pull request Sep 15, 2026
Cherry pick #118933 to 26.3: Split the ASan integration test jobs into eight batches
robot-clickhouse added a commit that referenced this pull request Sep 15, 2026
robot-clickhouse added a commit that referenced this pull request Sep 15, 2026
robot-clickhouse added a commit that referenced this pull request Sep 15, 2026
robot-clickhouse added a commit that referenced this pull request Sep 15, 2026
@robot-clickhouse robot-clickhouse added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Sep 15, 2026
PedroTadim added a commit that referenced this pull request Sep 15, 2026
Backport #118933 to 26.8: Split the ASan integration test jobs into eight batches
PedroTadim added a commit that referenced this pull request Sep 15, 2026
Backport #118933 to 26.7: Split the ASan integration test jobs into eight batches
PedroTadim added a commit that referenced this pull request Sep 15, 2026
Backport #118933 to 26.6: Split the ASan integration test jobs into eight batches
PedroTadim added a commit that referenced this pull request Sep 15, 2026
Backport #118933 to 26.3: Split the ASan integration test jobs into eight batches
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-ci-infrastructure CI/CD pipelines (GitHub Actions, CI scripts, runners). pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-ci pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR 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.

6 participants