Repository navigation
Fix flaky test 01661_extract_all_groups_throw_fast under memory pressure - #111513
Conversation
The first query materialized a ~1.3 GB haystack column (numbers(1023), each row up to 2.66 MB) only to trip the per-row regexp_max_matches_per_row (default 1000) fast-throw TOO_LARGE_ARRAY_SIZE. The throw fires on the first row (2600 matches); the rest of the column is wasted allocation. Under the shared parallel-runner memory budget, building it could hit MEMORY_LIMIT_EXCEEDED before the expected throw, so the test intermittently failed (0 master failures, 27 unrelated PRs in 30 days). Use a single materialized 1001-character row, which crosses the same per-row limit at ~1 KB instead of 1.3 GB. materialize() keeps the runtime code path the throw lives in. A low max_memory_usage on the query also guards against regressing to a large fixture. The second query is unchanged. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-author-slot-5:20260723-005400 |
Internal second-model review — adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 3 findings; bounded: 1 full pass + 1 fix round + 1 delta recheck). Delta re-review after fixes: 0 findings.
Severity: ❌ blocker / Session id: cron:clickhouse-author-slot-5:20260723-005400 |
|
cc @Ergus — could you review this? Test-only: 01661 tripped the per-row |
|
Workflow [PR], commit [b54dc15] Summary: ✅ AI ReviewSummaryThis PR replaces the first fixture in Final Verdict
|
CI finish ledger — b54dc15CI fully finished. All checks green (no failing test-level rows in CIDB; Mergeable Check and Finish Workflow both pass). No PR-caused failures, nothing to own.
Session id: cron:our-pr-ci-monitor:20260723-183000 |
…-extract-all-groups-memory-flake Fix flaky test 01661_extract_all_groups_throw_fast under memory pressure
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
The first query materialized a ~1.3 GB
haystackcolumn (numbers(1023), each row up to 2.66 MB) only to trip the per-rowregexp_max_matches_per_row(default 1000) fast-throwTOO_LARGE_ARRAY_SIZEinextractAllGroupsHorizontal. The throw fires on the first row (2600 matches); the rest of the column is wasted allocation. Under the shared parallel-runner memory budget, building it could hitMEMORY_LIMIT_EXCEEDEDbefore the expected throw, so the test intermittently failed (0 master failures, 27 unrelated PRs in 30 days).Replaced it with a single materialized 1001-character row, which crosses the same per-row limit at ~1 KB instead of 1.3 GB.
materialize()keeps the runtime (non-const) code path the throw lives in. A lowmax_memory_usageon the query also makes the throw deterministic under memory pressure and guards against regressing to a large fixture. The second "shouldn't fail" query is unchanged.Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=110567&sha=59463dc81a15d063a99e8803ccaaa66e374133da&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%29
Verified with a debug build: the old fixture throws
MEMORY_LIMIT_EXCEEDED(241) under a 100 MB query cap, the new one throwsTOO_LARGE_ARRAY_SIZE(128) even under a 20 MB cap; both queries pass 20/20 against a live server.regexp_max_matches_per_rowandmax_memory_usageare not in the CI random-settings pool, so the throw is deterministic.