Repository navigation
Pass the selected tests to clickhouse-test through a file - #126545
Merged
alexey-milovidov merged 1 commit intoOct 21, 2026
Merged
Conversation
`run_tests` ran the whole `clickhouse-test` command as one `bash -c` argument with every selected test after `--`. Linux caps a single argument at 128 KiB (MAX_ARG_STRLEN), so a PR that changes about 1,580 or more stateless tests (ClickHouse#126194: 2745 tests, 224,183 bytes of selectors) failed every flaky-check and targeted job with `[Errno 7] Argument list too long: '/bin/bash'` before the runner started. `run_tests` now writes the selection to `ci/tmp/test_list.txt` and passes it with the new `clickhouse-test --test-list-file` option (one selector per line, added to the positional ones; a file that lists nothing is an error, so an empty list never means the whole suite). `get_selected_tests` searched every selector in every suite file with `re.search`, and `re` caches only 512 compiled patterns, so with more selectors each call recompiled: about 41 minutes for 2745 selectors over 17,433 files, charged to `--global_time_limit`. The selectors are now compiled once (3.3 s for the same list, identical selection). `Targeting.selection_args` (shell quoting for the old command line) and its smoke case are no longer needed and are removed. Related: ClickHouse#126194 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review (click to expand): 0 changes requested, 2 findings dismissed with evidence
|
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261017-234400 |
Collaborator
Author
|
cc @maxknv, could you review this and add the |
Contributor
|
Workflow [PR], commit [391d3d6] Summary: ✅ AI ReviewSummaryPR #126545 passes selected stateless test regexes through Final Verdict✅ Approve. |
Merged
via the queue into
ClickHouse:master
with commit Oct 21, 2026
be84294
352 of 353 checks passed
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.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
The stateless flaky check and targeted check pass their selected tests to
clickhouse-testthrough a file, so a PR that changes thousands of tests no longer fails these jobs withArgument list too long.Description
Related: #126194 (failing job).
run_testsputs the selected tests after--in onebash -ccommand, and Linux caps a single argument at 128 KiB (MAX_ARG_STRLEN), soexecvefails with[Errno 7] Argument list too long: '/bin/bash'beforeclickhouse-teststarts. The 2745 selectors of #126194 take 224,183 bytes. The anchored selectors from my #122059 doubled their length, so the limit is now reached at about 1,580 changed tests.A file alone would expose a second problem:
get_selected_testscallsre.searchfor every selector on every suite file, andrecaches only 512 compiled patterns. For 2745 selectors that is about 41 minutes of selection (extrapolated from 142.6 s on 1,000 of the 17,433 test files), charged to--global_time_limit.Changes:
clickhouse-test: new--test-list-file, one selector per line, added to the positional ones. A file that lists nothing is an error, so an empty list never runs the whole suite.clickhouse-test: the selectors are compiled once.run_testswrites the selection toci/tmp/test_list.txtand passes that file. The unusedTargeting.selection_argsand its smoke case are removed.I did not cap the number of tests: the targeted check keeps every changed test on purpose, and the flaky check is already bounded by its time limit.
Validation (local, no test for the test infrastructure): the real
run_testswith the 2745 selectors fails with E2BIG before and hands over the byte-identical list after; selecting them takes 3.3 s and gives the same tests as the positional form; a flaky-check run of that list against a local server started running tests after 4 s.Workflow [PR]
Sync PR [sync-upstream/pr/126545]
Version info
26.11.1.468-master(included in26.11and later)