Round Float64 results in test 02931_rewrite_sum_column_and_constant#100409
Merged
alexey-milovidov merged 1 commit intoadd-arm-build-variants-and-stress-testsfrom Mar 23, 2026
Merged
Conversation
The test fails with TSan due to floating-point precision differences when random settings change the evaluation order of sum(constant - column). Wrap Float64 arithmetic queries with `round(..., 2)` to avoid flaky results. https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98677&sha=c1d06924bbc951a62ad4a320efdcb22722d72d4b&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%202%2F2%29 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Desel72
pushed a commit
to Desel72/ClickHouse
that referenced
this pull request
Mar 30, 2026
…rounding Round Float64 results in test 02931_rewrite_sum_column_and_constant
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.
Test
02931_rewrite_sum_column_and_constantfails under TSan with random settings due to floating-point precision differences. Whenoptimize_arithmetic_operations_in_aggregate_functionsis disabled,sum(2.11 - uint64)produces-4.45instead of-4.450000000000001. Both are valid results for the same mathematical value. Wrap Float64 arithmetic queries withround(..., 2)to avoid flaky results.https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=98677&sha=c1d06924bbc951a62ad4a320efdcb22722d72d4b&name_0=PR&name_1=Stateless%20tests%20%28amd_tsan%2C%20parallel%2C%202%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