Repository navigation
Conversation
…st distribution functional_tests.py can now distribute batched functional tests itself instead of relying on `clickhouse-test --run-by-hash-*`: - `clickhouse-test --list-tests FILE` writes the exact set of tests it would select (respecting tags, --no-long, --no-parallel/--no-sequential, and --test-list-file) to FILE, one per line, and exits without running anything or connecting to a server. - `clickhouse-test --test-list-file FILE` selects exactly the tests named in FILE by exact identity (extension-agnostic) rather than as regexes. When an explicit list is used, the parallel test order is no longer shuffled so the caller's order is preserved. - functional_tests.py lists the selectable tests, splits them round-robin into this job's batch, and passes the batch via --test-list-file. It fails the job explicitly (ERROR) if listing/distribution yields no tests. --run-by-hash-* remains supported in run_tests as a fallback for callers still using it. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Workflow [PR], commit [2196adc] Summary: ❌
|
|
CI Triage (bot) — head Verdict: LIKELY FLAKE — A single test A retry is recommended to confirm this is a transient failure. Run ID: 29931032059 |
…rve its order Addresses review on PR #111408: - --test-list-file now asserts it is not combined with --run-by-hash-num/--run-by-hash-total or positional test-name patterns. Previously the "exact list" was only intersected with those filters, so `--test-list-file list.txt --run-by-hash-total 2 --run-by-hash-num 0` could silently drop entries, making the exact-list contract false. - The list is loaded into an ordered mapping (test identity -> position in the file) instead of a set, and TestSuite orders the run by that position (in addition to skipping the shuffle). A precomputed, ordered schedule (e.g. a duration-balanced one) is therefore honored rather than re-sorted into numeric order. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Use the nightly per-test duration statistics (published by collect_test_duration_statistics, PR #111389) to balance batches by time instead of by count: - load_test_durations downloads test_statistics.json.gz from the public report bucket over plain HTTP (curl), so it works locally without AWS auth, and returns {test_identity: median_ms} for this job (batch suffix stripped to match the merged key). Missing/unavailable stats degrade to balancing by count rather than failing. - distribute_tests_into_batch now assigns tests with the greedy longest-processing-time heuristic (longest test to the least-loaded batch), which brings the per-batch estimated durations to within a second of each other on real data. Deterministic (ties broken by name); the group is written longest-first and --test-list-file preserves that order. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Listing/distribution deliberately runs without a server, so it cannot apply the per-test runtime skips from `TestCase.should_skip_test` (build-flag/tag skips like `no-asan`/`no-azure-blob-storage`, `--no-long`, the skip lists, cloud filters) - those depend on `args.build_flags`, which needs a running server. A lane-skipped test is still listed and distributed into a batch, then reported SKIPPED when that batch runs, which is harmless (it would not run anyway). Only the docs over-claimed: correct the `--list-tests` help and the `list_all_tests`/`list_selected_tests` docstrings to describe the pre-skip candidate set instead of the exact runnable set. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
load_test_durations referenced test_identity, which only existed in tests/clickhouse-test - undefined in this module (F821, and a runtime NameError). Add a local helper mirroring clickhouse-test's normalization so duration-stats names match the listed test identities. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
| # But when the caller supplied an explicit test list (--test-list-file), | ||
| # it already controls the exact set and their order (e.g. a precomputed, | ||
| # deterministically distributed batch); preserve that order instead of | ||
| # reshuffling it here. |
There was a problem hiding this comment.
test_list_order only preserves the caller's order inside self.all_tests. The next loop immediately repartitions that ordered list into parallel_tests and sequential_tests, and do_run_tests always drains the parallel bucket before the sequential one. A file like [00024_random_counters, 00001_select_1] therefore still runs 00001_select_1 first, so the new "--test-list-file runs tests in file order" contract is still false for any batch that mixes no-parallel and parallel tests.
Please either preserve one global ordered schedule while honoring sequential-only tests, or stop claiming exact file-order execution and generate/document the list in the runner's actual parallel -> sequential order.
Lets
functional_tests.pycontrol which functional tests run in a batched job instead of delegating batching toclickhouse-test --run-by-hash-*. The job asksclickhouse-test --list-testsfor the exact selectable set, splits it across batches balanced by median per-test duration, and passes this job's share back via--test-list-file.New
clickhouse-testoptions:--list-tests FILE: write the exact set of tests that would be selected (respecting tags,--no-long,--no-parallel/--no-sequential, and--test-list-file) toFILE, one name per line, then exit without running anything or connecting to a server.--test-list-file FILE: select exactly the tests named inFILEby exact identity (extension-agnostic) rather than as regexes, and run them in the file's order. It is mutually exclusive with--run-by-hash-num/--run-by-hash-totaland positional test-name patterns (asserts if combined), so the "exact list" contract holds.Distribution uses the nightly median per-test durations published by
collect_test_duration_statistics(#111389).functional_tests.pyfetchestest_statistics.json.gzfrom the public report bucket over plain HTTP (works locally without AWS auth) and assigns tests to batches with the greedy longest-processing-time heuristic, bringing per-batch estimated durations to within ~1s of each other on real data. Missing/stale statistics degrade to balancing by test count rather than failing. If listing or distribution yields no tests the job fails explicitly (ERROR) rather than silently changing the distribution.Related: #111389
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
🤖 Generated with Claude Code