Fix flaky test 03801_materialized_cte#100384
Merged
Algunenano merged 2 commits intomasterfrom Mar 23, 2026
Merged
Conversation
The `EXPLAIN QUERY TREE` output contains node IDs (`id: N`, `source_id: N`) that come from a global counter and are not deterministic when running in parallel with other queries. The test already normalized UUIDs in temporary table and CTE names but did not normalize node IDs. Add a `REGEXP_REPLACE` to replace all `id: <number>` and `source_id: <number>` patterns with `id: N` and `source_id: N` respectively. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100373&sha=4717161518a29a179c942d56728f7220300024d6&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%201%2F2%29 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Workflow [PR], commit [03fb8c2] Summary: ✅ AI ReviewSummaryThis PR stabilizes flaky test ClickHouse Rules
Final Verdict
|
1 task
The third query uses `GROUP BY uid, uid + 1`. When `optimize_group_by_function_keys` is randomly enabled in flaky check, the optimizer removes `uid + 1` (a function of `uid`), changing the GROUP BY node count. Pin the setting to make output deterministic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Algunenano
approved these changes
Mar 23, 2026
1 task
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.
Fix flaky test
03801_materialized_cteby normalizing non-deterministic node IDs inEXPLAIN QUERY TREEoutput.The
EXPLAIN QUERY TREEoutput contains node IDs (id: N,source_id: N) from a global counter that shifts when other queries run in parallel. The test already normalized UUIDs in temporary table and CTE names but did not normalize these node IDs.CI report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=100373&sha=4717161518a29a179c942d56728f7220300024d6&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%201%2F2%29
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Documentation entry for user-facing changes