Repository navigation
Tighten coverage tests added in #103456 - #103618
Merged
Merged
Conversation
…04135, 04140) Several of the tests added in PR #103456 codified weak or wrong expected output because they were generated by a low-reasoning agent that accepted whatever the server returned. This commit fixes the assertions so the tests actually discriminate between correct and broken behaviour. - 04121: Replace `JSONExtract('{"x": 3.14}', 'x', 'Variant(String, Int64, Float64)')` which returned 3 (silent truncation) with `Variant(String, Float64)` which returns 3.14. The truncation case is tracked separately in #103617. - 04128: The original `sequenceNextNode` matrix used `(time, event, event='A', event='B')` arguments where `event='A'` is the base condition and `event='B'` is chain[0]; both must be true on the same row, which is impossible for mutually exclusive predicates. Every two-matcher case returned `\N`, exercising no traversal. Rewritten so the direction x base matrix produces six distinct non-NULL results plus a non-trivial GROUP BY merge. - 04131: PromQL evaluator coverage for selector-based queries (rate, by/without, group_left/right, prometheusQueryRange) is unverifiable because the `TimeSeries` engine does not support direct INSERT (`NOT_IMPLEMENTED`). Added a scope note clarifying that those `count() == 0` assertions exercise only the parser surface and an evaluator regression on an empty selector would need a separate integration test. - 04132: Replaced `SELECT name, serialization_kind FROM system.parts_columns` with `SELECT column, serialization_kind`. `name` is the part name (`all_1_1_0`), so the original query returned three identical part-name rows and gave no information about which column got which serialization. The fixed query returns `id Default / s Sparse / v Sparse`. - 04134: Removed the misleading `any_value of Tuple via ORDER BY LIMIT 1` section: it was claimed to "still exercise the tuple code path deterministically" but `ORDER BY val LIMIT 1` invokes the sort path, not `any()/anyLast()` over `SingleValueDataGenericWithColumn`. The header now states explicitly that `any/anyLast` are excluded because they return unspecified rows under parallelism. The empty-input case is renamed and asserts only `min/max/argMin/argMax`. - 04135: The original `Int32 -> Int8` coerce used value 42, which fits in `Int8`, so a silent-truncation regression would have passed. Switched to value 200 and codified the resulting `-56` wrap explicitly so the test now detects regressions in the narrowing path. Tightened the error matcher from `Code: [0-9]*` to `Code: [0-9]+`. - 04140: The original "filter pushdown" and "column pruning" sections only asserted result correctness; a regression that disabled pushdown or read all columns would still pass. Added profile-event assertions: ParquetPrunedRowGroups for row-group pruning (5000 rows / 500 per group => 10 groups, expecting `read=1 pruned=9`) and ParquetDecodingTasks for column pruning (single-column read should issue fewer decoding tasks than reading all columns). Also asserts result equivalence with `input_format_parquet_filter_push_down=0`. Discovered while reviewing #103456. The PR has been merged, so this lands as follow-up rather than amend.
Contributor
|
Workflow [PR], commit [842cf0a] Summary: ✅ AI ReviewSummaryThis PR tightens several recently added stateless tests so they validate real behavior instead of weak/non-discriminating outputs, mainly in ClickHouse Rules
Final Verdict
|
This was referenced Apr 27, 2026
CI failure: under parallel Parquet decode, --print-profile-events emits
ParquetDecodingTasks (and other counters) on multiple lines, one per
thread/batch. The original awk patterns assumed a single line per counter,
so:
- The pushdown awk picked the LAST counter line (truncating partial sums).
- The column-pruning ONE=$(...) captured a multiline string ('1\n1'),
which then failed the `[ "$ONE" -lt "$ALL" ]` numeric test as a syntax
error and let the script proceed past the assertion silently.
Fix:
- Sum counter values across all matching lines.
- For pushdown, emit a binary "pruned" / "not pruned" verdict instead of
the exact counts, since the work distribution across threads is not
pinned. A regression that disables pushdown would still flip the
verdict (pruned > 0 -> 0).
- For column pruning, sum decoding tasks for one-column and all-column
reads and assert the former is strictly smaller.
CI report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=103618&sha=0bb58ad618e1fe94ae773f5fc391540acc7d568d&name_0=PR&name_1=Stateless%20tests%20%28amd_asan_ubsan%2C%20distributed%20plan%2C%20parallel%2C%201%2F2%29
See #103618
alexey-milovidov
approved these changes
Apr 28, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Apr 28, 2026
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.
Follow-up to #103456 (which has been merged). That PR added 28 stateless tests
generated by an AI on lowest-thinking level. A focused review surfaced several
weak or wrong expected outputs that were codified rather than tested. This PR
tightens the worst offenders so the tests actually discriminate between correct
and broken behaviour.
Per-test summary:
04121
JSONExtractVariant — replacedVariant(String, Int64, Float64)3.14(which silently truncates to3) withVariant(String, Float64)which returns
3.14. The truncation case is a real bug and is tracked inJSONExtract into Variant silently truncates fractional JSON numbers when an integer member exists #103617.
04128
sequenceNextNode— original two-matcher cases all returned\Nbecause the base condition (
event='A') and chain[0] (event='B') aremutually exclusive on the same row, so
getBaseIndexnever selected a base.Rewritten so the direction × base matrix produces six distinct non-NULL
results plus a non-trivial GROUP BY merge.
04131
prometheusQueryparser —INSERTis not supported by theTimeSeriesengine (NOT_IMPLEMENTED). Added a scope note clarifying thatcount() == 0assertions exercise only the parser surface and an evaluatorregression on an empty selector would need a separate integration test.
04132
ColumnSparseparts_columns —SELECT name, serialization_kindreturned the part name (
all_1_1_0) three times, giving no informationabout which column got which serialization. Changed to
SELECT column, serialization_kindwhich now returnsid Default / s Sparse / v Sparse.04134
SingleValueDataGenericWithColumn— removed the misleadingany_value of Tuple via ORDER BY LIMIT 1section:ORDER BY ... LIMIT 1invokes the sort path, not
any()/anyLast(). Header now states explicitlythat
any/anyLastare excluded because they return unspecified rows underparallelism.
04135
BSONEachRowcoerce — originalInt32(=42) -> Int8writes a valuethat fits in
Int8, so a silent-truncation regression would have passed.Switched to
200::Int32 -> Int8and codified the resulting-56wrapexplicitly. Tightened the error matcher from
Code: [0-9]*toCode: [0-9]+.04140
Parquet— added profile-event assertions for the pushdown /pruning sections that previously only checked result correctness:
ParquetPrunedRowGroups: 5000 rows / 500 per group → 10 groups, expectread=1 pruned=9forWHERE n BETWEEN 100 AND 200.ParquetDecodingTasks: single-column read should issue fewer decodingtasks than reading all columns.
Also asserts result equivalence with
input_format_parquet_filter_push_down=0.All seven tests verified locally against
clickhouse local26.5.1.111.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not for changelog (changelog entry is not required)
Documentation entry for user-facing changes
Version info
26.5.1.159