Repository navigation
Conversation
|
Workflow [PR], commit [31303aa] Summary: ❌
AI ReviewSummaryThis PR moves stateless tests into parallel execution using per-run fixtures, file sandboxes, and concurrency groups. Most previously reported races and weakened assertions are addressed. Three concerns remain: worker recovery can deadlock, full flaky checks still overlap fixtures that are unique only per file, and server-wide primary-key loading loses its regression coverage. Reviewed head: Missing context / blind spots
Findings❌ Blockers
Tests
Final VerdictStatus: ❌ Block. Prevent the recovery deadlock, make full flaky execution safe for the remaining fixed fixtures, and preserve server-wide primary-key load coverage. |
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
…::clearTable The previous fix (a37fd15) covered the four prefix-eviction call sites but missed clearTable, which also passes a lambda to remove on a cache keyed by UInt128. Use the same explicit std::function pattern. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=4eb73d7d3388494c644fd1f745a7070a8d7f913a&name_0=PR&name_1=Fast%20test PR: #110015
Commit 4eb73d7 tagged three tests with `no-parallel:remote-databases` and extended the style-check allowlist, but missed the runner's own `NO_PARALLEL_GROUPS` set, so `clickhouse-test` aborted on startup with `TestException: Unknown no-parallel concurrency group: remote-databases`. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=a1111845ace77c5267240ec35a6b59c04503f297&name_0=PR&name_1=Fast%20test PR: #110015
Test-side fixes:
- Sandbox-relative `file()` paths: 15 `.sh` tests wrote data into the per-test
`$CLICKHOUSE_USER_FILES_UNIQUE` sandbox but still referenced bare relative
names in queries, which the server resolves against the `user_files` root;
all such references now carry the `${CLICKHOUSE_TEST_UNIQUE_NAME}/` prefix
(also covers `no-fasttest` tests that would have failed later in Stateless).
- Global-entity cleanup: `03231`, `03353`, `03636` never dropped their
users/roles/quotas and now trip the runner's leak check; `02883` dropped
`$u2` twice instead of `$u3`.
- Comment attachment in `query_log`: the leading comment block of a `.sql`
file is part of the first query's logged text, so `query LIKE 'SELECT ...%'`
filters in `02385` and `03272` never matched; both now find their queries by
a per-query `log_comment` setting.
- `00693` compared consecutive server-wide counts of `system.tables` /
`system.columns`, which is racy under parallel DDL; the counts are now
scoped to `currentDatabase()` over a fixed set of own tables.
- `02494_query_cache_user_quotas*`: `query_cache_max_entries` /
`query_cache_max_size_in_bytes` are per-user quotas counted across the
whole server-wide query cache and all tests run as the same user, so these
two tests got their `no-parallel` tag back with a documented reason.
- `03444`: without a leading `-- Tags:` line the client does not skip a
leading comment block (`getTestTagsLength`), the block glues to the first
query, and its parse-time `clientError` hint is not honored (the hint
search after a parse exception covers only the first line); the obsolete
leading comments are removed. Verified against a master binary.
- Stale references updated for `03460` (echoed query text) and `02101`
(identifier no longer needs backquotes).
- `02950` counts shard sub-queries in `query_log`, which log
`current_database = 'default'` on localhost clusters; the filter is now
`current_database IN (currentDatabase(), 'default')`.
Server-side fix:
- `MergeTreeDataPartWide::removeMarksFromCache` enumerated serialization
streams, which for columns with data-dependent substreams (`Dynamic`,
`JSON`) misses the variant streams without a deserialization state, so
`SYSTEM CLEAR MARK CACHE FOR TABLE` left their marks cached (seen as a
wrong `FileOpen` count in `03198`). It now iterates `checksums.files`,
which lists the mark file of every stream actually present in the part.
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=6b35b72fc6a86e7f63fcdd1276c4bf189310046b&name_0=PR&name_1=Fast%20test
PR: #110015
…erver-wide user RESTORE - The databases `shard_0`/`shard_1` are shared fixtures hardcoded by the `test_cluster_two_shards_different_databases` cluster config, so parallel tests cannot rename them. Nine untagged tests still dropped these databases at start or end, destroying them for every concurrently running test (this is what failed `02915_move_partition_inactive_replica` and `01231_distributed_aggregation_memory_efficient_mix_levels`). All nine now only `CREATE DATABASE IF NOT EXISTS` and create/drop their own uniquely-named tables inside; generic table names (`tbl`, `t_local`, `t_sus`, `v_sus`, `test`) got per-test suffixes. `01152`'s unscoped `SHOW TABLES FROM shard_N` is scoped by `LIKE` to stay deterministic. - `03231_restore_user_with_existing_role` and `04027_restore_access_entities_with_current_grants` get their `no-parallel` tag back: `BACKUP TABLE system.users` snapshots every user on the server and `RESTORE ALL` recreates them all, changing the UUIDs of users created by concurrent tests and breaking their in-flight sessions (this is what failed `03748_async_insert_reset_setting`, which is untouched and almost never flaky on master). The tests' own header comments already explained the constraint; the migration untagged them regardless. CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=a9951d3b2349cb32453cfbcccfbd6e624bab7a55&name_0=PR&name_1=Fast%20test PR: #110015
- `02024_merge_regexp_assert`: `merge(REGEXP('.'), '^t$')` scans every database on the
server, so a concurrent test's table named `t` changes the query outcome (`REGEXP`
requires a literal, so the pattern cannot be scoped to `currentDatabase()`).
- `02494_query_cache_user_quotas*`: reverted to the master version (unscoped
`SYSTEM CLEAR QUERY CACHE`, unfiltered counts) with the `no-parallel` reason spelled
out. The tag-scoped migration failed even when running solo: the per-user quota counts
entries across the whole query cache, including entries left by earlier tests, so the
quota was already exhausted before the test inserted anything.
Not addressed here, watch for recurrence: `02346_text_index_header_cache` (one
unexplained header-cache eviction between two queries; the label/prefix scheme rules
out cross-table matches) and `04337_quorum_insert_honors_time_limit` (quorum wait
aborted with `UNKNOWN_STATUS_OF_INSERT` under load, 1 failure in 64k runs on record).
CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=a4544f5b3d0e5728cece863b4a69f500bdb79499&name_0=PR&name_1=Fast%20test
PR: #110015
Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=4148e9cb9aef4cd42def363396465967f2a36430&name_0=PR&name_1=Stateless+tests+%28arm_binary%2C+parallel%29 PR: #110015 Three families and four individual fixes: 1. user_files sandbox relative paths (5 tests): the tests write data into the per-test sandbox `$CLICKHOUSE_USER_FILES_UNIQUE/<file>` but called `file('<file>')` with a bare relative name, which the server resolves against the global `user_files` root -> `CANNOT_STAT` / empty globs. Prefix the paths with `${CLICKHOUSE_TEST_UNIQUE_NAME}/`: `02240_tskv_schema_inference_bug`, `02242_arrow_orc_parquet_nullable_schema_inference`, `02247_names_order_in_json_and_tskv`, `02459_glob_for_recursive_directory_traversal`, `02286_mysql_dump_input_format` (dump4-dump15 were missed by the migration). An audit of all other sandbox-using tests found no more instances. 2. Stale references after scoping cache clears (3 tests): the queries were changed to `SYSTEM CLEAR FILESYSTEM CACHE '<name>'` but the `-- { echo }` references still had the unscoped form: `00170_s3_cache`, `02240_filesystem_cache_bypass_cache_threshold`, `02240_filesystem_query_cache`. 3. `02226_filesystem_cache_profile_events`: the cache of the `azure_cache` storage policy is registered under the disk name `cached_azure`, so `SYSTEM CLEAR FILESYSTEM CACHE 'azure_cache'` failed with BAD_ARGUMENTS. Map the policy name to the cache name. 4. `01532_execute_merges_on_single_replica_long`: restore the fixed ZooKeeper path. The merging replica is picked by `hash(zookeeper_path + part_name)`, and the reference asserts which replica merges each part; `{database}` in the path randomized the assignment. The path is unique to the test and `--no-self-parallel` serializes flaky-check copies, so it stays parallel-safe. 5. `02346_text_index_direct_read`: scope the `system.text_log` scan to this test's queries via `system.query_log` - concurrent tests' text-index queries also log `Added:` messages and leaked into the last-8 window. 6. `00140_rename`: replace `CREATE TABLE ... CLONE AS test.hits` with a minimal local fixture. `CLONE` inherits the source storage, which is static (read-only) when the stateful tables are attached from a web disk, and the internal `ATTACH PARTITION` fails with TABLE_IS_PERMANENTLY_READ_ONLY. Only the two counters the assertions read are copied; reference values are unchanged. 7. `03710_parallel_alter_comment_rename_selects`: scope the `system.databases`/`system.tables` scans to the test's own databases. An unfiltered scan iterates every database, including concurrent tests' remote databases with unreachable hosts, whose connection errors failed the scan (exit code 35). The pushed-down predicate keeps the rename/comment/scan lock interplay the test hunts.
Report: https://s3.amazonaws.com/clickhouse-test-reports/PRs/110015/8ced04efa4ab1e61d6f67c41658b41fff335016d/result_pr.json PR: #110015 - Style check: four tests merged from master document their `no-parallel` reason as `# no-parallel: ...`; the check requires the `Tag no-parallel:` form. Convert the comments (the tags themselves are legitimate: global `PAUSEABLE_ONCE` failpoints). - Fast test: `04249_query_condition_cache_fine_grained_granules` asserts that the query condition cache entry written by the first query is still present for the second one. The intervening `SYSTEM FLUSH LOGS` plus `query_log` scan opened a seconds-long window under the parallel pool, in which concurrent tests' cache writes could evict the entry (release-build entries now also store the condition text, increasing churn), producing `0 100` instead of `1 1`. Run the two queries back-to-back and do both `query_log` checks afterwards; the reference is unchanged.
…ows, restore no-parallel on 00170 Report: https://s3.amazonaws.com/clickhouse-test-reports/PRs/110015/6e829e5ca1b671fdf00ae6968a300846fbc93368/result_pr.json PR: #110015 - `02578_parameterized_rename_queries` (amd_tsan, flaky check) and `01224_no_superfluous_dict_reload` (arm_binary, parallel): unfiltered or name-only `system.tables` scans iterate every database, so concurrent tests' databases fail the query - a remote database with an unreachable host (`ALL_CONNECTION_TRIES_FAILED`) in the first case, a readonly table (`DATABASE_ACCESS_DENIED`) in the second. Scope both scans with a database predicate, which is pushed down before iteration. - `03229_query_condition_cache_profile_events` (arm_binary, parallel) and `02226_filesystem_cache_profile_events` (arm_asan_ubsan, targeted): cache-hit assertions raced with concurrent cache traffic - the flush plus query_log scan between the populating query and the hitting query is a seconds-long LRU eviction window (the shared s3_cache is 200 MiB; QCC entries now also store condition text). Run the profiled queries back-to-back and do all query_log checks afterwards, like 04249_query_condition_cache_fine_grained_granules. In 02226 also keep the policy-to-cache-name mapping from the previous commit. - `00170_s3_cache` (amd_tsan, parallel: "Server died"): restore the `no-parallel` tag. The server did not die - it was stopped normally at job end; the report came from this test exceeding the 180 s per-test budget (about 100 s alone under TSan, more in a loaded pool), whose timeout hung-check cascade aborted the run. Master also keeps this test `no-parallel` for heaviness; the scoped filesystem-cache clear stays. - `02241_filesystem_cache_on_write_operations` timed out once on arm_binary (reruns passed); left unchanged as a transient, watching.
Report: https://s3.amazonaws.com/clickhouse-test-reports/PRs/110015/4a1c3532d1f/result_pr.json (Fast test at 4a1c353) PR: #110015 The previous commit placed an explanatory comment directly above the second profiled query. In `.sql` tests a comment is sent as part of the following statement, so the logged query text no longer matched the exact-text `query = '...'` filter in the check, which returned zero rows. Attach the comment to the `SYSTEM FLUSH LOGS` statement instead, whose text nothing matches. (`04249` was unaffected by the same restructure because it filters by `log_comment`.) Also seen in that run: `01165_lost_part_empty_partition` failed with `NOT_INITIALIZED` when re-creating a replicated table on a just-dropped ZooKeeper path - a pre-existing low-rate flaky unrelated to this branch (the test is unchanged here and fails sporadically on other PRs).
…eration, isolate 02226 caches, misc Report: https://s3.amazonaws.com/clickhouse-test-reports/PRs/110015/9b93b8fe75d544d6d86be589410072aec1e618d2/result_pr.json PR: #110015 - `DatabaseMySQL::getTablesIterator` no longer throws on connection failures and serves the (possibly stale or empty) local cache, mirroring `DatabasePostgreSQL::getTablesIterator`. Enumeration - `system.tables` / `system.columns` scans, completion suggestions, and unknown-table-name hints (the default `getAllTableNames` routes through the iterator) - used to fail arbitrary concurrent queries while a remote database with an unreachable endpoint existed. This is what failed `01502_long_log_tinylog_deadlock_race` (amd_tsan, flaky check): its expected `UNKNOWN_TABLE` errors turned into `ALL_CONNECTION_TRIES_FAILED` while the hint generator iterated a concurrent test's `fake_db`. New test `04512_mysql_database_unreachable_host_enumeration` covers it. - `02226_filesystem_cache_profile_events` (arm_asan_ubsan, targeted): give the test its own inline cache disks over the same three backing stores (s3_disk / local_disk / azure). The shared `s3_cache` is 200 MiB and is thrashed by concurrent tests - this round every read bypassed the full cache (source reads with zero cache writes), previous rounds saw evictions between queries. Assertions about hit/miss sequences need a cache nothing else touches. - `01010_pmj_right_table_memory_limits` (arm_binary, parallel, reproducible): pin `collect_hash_table_stats_during_joins = 0`. A size hint from the server-global hash-table statistics cache enables exact preallocation and keeps the join's peak memory under the 32 MB limit the test expects to exceed; once the cache is seeded the test fails deterministically. - `02494_query_cache_ttl_long` (arm_binary, parallel): restore `no-parallel`. The test asserts a stale query-cache entry stays visible until refreshed, but any concurrent query-cache insert evicts stale entries cache-wide - tag scoping cannot help. - Add `no-flaky-check` to four heavy tests that exceed the 180 s per-test budget when the flaky/targeted check reruns them on sanitizer/debug builds with fresh random settings: `00077_log_tinylog_stripelog`, `01111_create_drop_replicated_db_stress` (up to ~6 min on sanitizers), `02346_text_index_hits`, `03791_rmt_watches`. Left unchanged (single-shot races, clean reruns, watching): `03254_prewarm_mark_cache_rmt` (prewarm-on-attach race), `01501_cache_dictionary_all_fields`, `02240_filesystem_query_cache`, `04004_dist_index_analysis_poisons_query_condition_cache`, `01338_long_select_and_alter`, `03312_line_numbers`, `02481_async_insert_dedup_token`, `01165_lost_part_empty_partition`.
|
|
||
| struct Entry | ||
| { | ||
| #if defined(DEBUG_OR_SANITIZER_BUILD) |
There was a problem hiding this comment.
I remember I added the ifdefs long time ago. Why are the extra members no longer considered too expensive for release builds?
There was a problem hiding this comment.
Only table_uuid moved out of the DEBUG_OR_SANITIZER_BUILD block. The expensive String fields (part_name / condition) and condition_hash are still debug-only.
The release-build change here is just the fixed-width UUID, because SYSTEM CLEAR QUERY CONDITION CACHE FOR TABLE ... needs a stable per-entry table identifier and the cache key is a one-way hash, so there is no other way to recover the owning table from an entry during eviction.
…g-test timeouts Report: https://s3.amazonaws.com/clickhouse-test-reports/PRs/110015/aa6cb50e5315ea40ced929ea0de37d8696f6ad7c/result_pr.json PR: #110015 - clickhouse-test: `long` tests get `max(--timeout, 600)` instead of the flat 180s default. `02241_filesystem_cache_on_write_operations` (already `long`, killed at exactly 180s on arm_binary under parallel load) and other `long` tests keep the pre-parallelization budget that the 600s master default gave them. The worker SIGALRM window scales accordingly. - The `remote-databases` concurrency group is dissolved; its members (04512, 04210, 04507, 03525) go back to plain `no-parallel`. While an unreachable remote database exists, any concurrent query that enumerates databases (`system.tables`/`system.columns` scans, name hints) triggers connection attempts whose Error-level log lines (`mysqlxx::Pool`, connection-failure logging) are attributed to that query and forwarded to its client. This failed 00722_inner_join and 01602_temporary_table_in_system_tables (arm_binary, parallel) and 00693_max_block_size_system_tables_columns (amd_debug, flaky check, 4x) with "having stderror". A group cannot help: the victims are arbitrary ungrouped tests. - 02911_row_policy_on_cluster: converted to .sh; the row policy now targets the test's own database with unique entity names instead of `default.*`. The old policy denied `default.*` to every other user while it existed, which broke the XML-dictionary tests 00950_dict_get and 01501_cache_dictionary_all_fields (amd_msan, flaky check) with "Table default.ints/decimals has row policies, but none of them are for the current user". - 02252_jit_profile_events: back to plain `no-parallel`. The compiled-expression cache is server-global and keyed by function signatures, not query text; any concurrent query JIT-compiling a matching signature (e.g. three `avg(UInt64)` aggregates, `compile_aggregate_expressions` is default-on) pre-warms the entry and `CompileFunction` drops to 0 (5x amd_tsan + 1x amd_debug flaky checks). - 03985_prewarm_index_mark_cache: back to plain `no-parallel`. The stateless mark cache is only 128 MiB (`small_caches.xml`); concurrent tests push it above `mark_cache_prewarm_ratio` (prewarm skips parts) or evict prewarmed entries, flipping "after prewarm on restart" from 0 to 1. - 02286_drop_filesystem_cache: back to plain `no-parallel`; exact per-file cache entry counts are sensitive to load-dependent segmentation (1 -> 2 entries on arm_binary, parallel). - 03652_threads_count_insert: pin `use_concurrency_control = 0` instead of relying on an idle server; concurrency control grants fewer thread slots under concurrent load, which turned `peak_threads_usage` 7 into 4 (amd_debug, parallel). The test stays parallel. - 02962_system_sync_replica_lightweight_from_modifier: tag as `long` (10 replicas, wall-clock-bounded insert/sync/drop loops) - it timed out at the 180s cap in the amd_asan_ubsan flaky check. - 00090_thread_pool_deadlock: restore `no-parallel`. It deliberately saturates the global thread pool; run in parallel it starved concurrent tests into `CANNOT_SCHEDULE_TASK` failures (amd_tsan) and contributed to the global time-limit "Server died" verdicts - both such runs show a cleanly alive server, just a suite stalled by contention. - test_mysql_database_engine/test_mysql57_database_engine test_restart_server: enumeration of a MySQL database with an unreachable endpoint no longer throws (it serves the empty post-restart cache, consistent with PostgreSQL), so assert the tolerated behavior instead of expecting an exception.
…extras Addresses the review comment from @rschu1ze on #110015: the extended Entry members were considered too costly for release builds when the ifdefs were introduced, and this branch had dropped the guard entirely. The guard is restored for the costly members - `part_name` (String), `condition` (String) and `condition_hash` - in Entry, EntryWeight, the write path and system.query_condition_cache (columns are again debug/sanitizer-only, docs updated, 03460 gets its `no-release` tag back). Only `table_id` stays in release builds: `clearTable` (backing `SYSTEM CLEAR QUERY CONDITION CACHE FOR TABLE`) selects a table's entries by it and cannot use the key (a one-way CityHash128), and the parallel-safe tests scope their `system.query_condition_cache` scans by the `table_uuid` column. Unlike the strings it is a fixed 16 bytes per entry. PR: #110015
Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=c75dc707c9b0862a38a28229dc200e2e8bc670fb&name_0=PR&name_1=Style%20check PR: #110015 Tests that arrived with the master merge, checked against this branch's rules: - 04338_query_condition_cache_topk_part_set_invalidation: scope the two global `SYSTEM CLEAR QUERY CONDITION CACHE` to `FOR TABLE tab` - every assertion in the test is a per-query `log_comment` ProfileEvents check on `tab`, so the scoped clear preserves the semantics and keeps the test parallel-safe. - 03814_system_unload_dictionary: document the `no-parallel` reason (`SYSTEM UNLOAD DICTIONARIES` unloads every dictionary on the server). - 04000_empty_part_stale_tmp_dir, 04401_replicated_database_ddl_status_finished_node_missing: reformat the existing reason comments to the `Tag no-parallel:` form the style check recognizes. - 04538_materialized_view_comment_implicit_alias{,_message}: drop `no-parallel` entirely - both tests only touch objects in their own database and filter `system.tables` by `currentDatabase()`.
The style check evaluates the PR after merging current master, which added test 03908 with a reason comment that does not use the recognized prefix. Add the upstream test version with the required `Tag no-parallel:` form so the synthetic merge contains only the comment fix. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=bbc75fa974e3359dc121a0d9f4938e7bde490a7a&name_0=PR&name_1=Style%20check PR: #110015
Resolve the post-merge conflict in test 03908 with the required `Tag no-parallel:` reason prefix. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=bbc75fa974e3359dc121a0d9f4938e7bde490a7a&name_0=PR&name_1=Style%20check PR: #110015
Resolve the style-check conflict by retaining the scoped cache-clear and grouped `no-parallel` checks together with the new global async-insert flush check from `master`. Update newly merged tests to use the required `Tag no-parallel:` reason prefix. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=da159ca3a25e939187f01f71b3b26847958c9fdc&name_0=PR&name_1=Style%20check PR: #110015
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=110015&sha=6854c298905d73d6fa05374856c307c62d80e2d9&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20ParallelReplicas%2C%20s3%20storage%2C%20parallel%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.
|
|
Not caused by this PR. The fix is #123121 (mine, open). This run fails in query 26 on the |
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=110015&sha=6854c298905d73d6fa05374856c307c62d80e2d9&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20AsyncInsert%2C%20s3%20storage%2C%20parallel%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.
|
|
Not a hang. Under async inserts the 80 setup INSERTs are slow, and the 300 s cap in this PR turns that into a failure.
Fix for 03822: run the setup INSERTs with |
|
The fix for |
| if not p.is_alive(): | ||
| # A worker that died mid-test still holds its group in the | ||
| # scheduler; release it so the group's other tests can run. | ||
| shared_queue.finish_previous_test(p.worker_index) |
There was a problem hiding this comment.
[P1] Detect worker failure before taking its scheduler lock
If a worker is killed while inside pop_for_worker or finish_previous_test, the manager-backed Lock remains acquired. This recovery call then blocks the parent indefinitely, before it even checks the worker's nonzero exit code; the global deadline and hung checks also stop running. A focused probe using the actual ParallelTestScheduler reproduced a worker exiting with SIGKILL and finish_previous_test remaining blocked.
Please check unexpected worker exits first and abort/quiesce the run without acquiring worker-owned locks, or move scheduling into a process that survives worker death. Forcibly unlocking and continuing is unsafe because the killed worker may have partially updated the queue and group ownership.
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=110015&sha=c733161a6a81ed345ff294e7136eca3655c3930f&name_0=PR&name_1=Stateless%20tests%20%28amd_debug%2C%20parallel%29 and provide a fix in a separate PR. If the fix is already in progress, link it here.
|
|
I'm working on it and will link the fix PR here. What I found so far:
|
|
The fix is in #125753: accepted sockets are now close-on-exec, so processes the server starts no longer keep a client connection open, and |
Make stateless test execution more parallel-safe through per-run identities, per-test `user_files` sandboxes, `no-parallel` concurrency groups, self-parallel control in `clickhouse-test`, and targeted rewrites of tests that depended on fixed global state. Tests that cannot be isolated keep plain `no-parallel` with a documented `Tag no-parallel:` reason, which the style check now enforces for new tags. #110015
| @@ -39,7 +37,8 @@ WHERE | |||
| ORDER BY table; | |||
|
|
|||
| SELECT '-- Load primary key for all tables'; | |||
| SYSTEM LOAD PRIMARY KEY; | |||
| SYSTEM LOAD PRIMARY KEY test; | |||
There was a problem hiding this comment.
[P2] Preserve coverage of server-wide primary-key loading
Replacing the table-less SYSTEM LOAD PRIMARY KEY with two table-scoped calls removes the suite's only runtime coverage of the server-wide form. These commands take a different branch of InterpreterSystemQuery::loadOrUnloadPrimaryKeysImpl: they do not exercise its catalog iteration. Removing the load operation from that iteration would now leave every remaining primary-key load test passing, whereas the original memory assertions detected it.
Please retain an isolated table-less load check that first unloads both fixtures and then verifies that the global command restores their primary-key memory. The table-scoped cases can remain parallel.
This PR makes stateless test execution more parallel-safe through per-run identities, per-test
user_filessandboxes,no-parallelconcurrency groups, self-parallel control, and targeted rewrites of tests that previously depended on fixed global state.The cache-scoping
FOR TABLEfeature is intentionally not part of this PR. The 43 tests that had depended on it, plus three additional tests that used the scoped syntax, are kept with plainno-paralleltags and documented reasons, preserving their sequential isolation.The remaining migration uses unique per-run names, isolated files, query-cache tags, filtered log assertions, and documented serialization groups where those mechanisms are sufficient.
Original CI context: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110015&sha=70fb487d370029230f4968a6ea70a8ca86d9ae96&name_0=PR&name_1=Fast%20test%20%28arm_darwin%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Make more stateless tests safe to run in parallel.
Workflow [PR]
Sync PR [sync-upstream/pr/110015]