Repository navigation
fix(tests): compare the two ingest paths' daily avg within tolerance - #132
Merged
Merged
Conversation
#123 was branched before #128 gave ResponseError a content_type field and merged after it, so main stopped compiling at the three places the binary path builds one. All three are raised by the SDK with no server response behind them (a 204 that fails to deserialize, a value refused locally, a series /byids cannot find), so each carries None. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
test_datapoints_binary truncated avg/min/max to ten decimals and required the binary and JSON series to match exactly. It failed twice in a row on one bucket of 60 (2025-02-28): avg 179.9759117537 against ...538, min and max identical, both series walked to all 5,184,000 points. A dropped or duplicated point moves a daily avg by ~1e-3; a 1e-10 difference is ClickHouse summing the two series' parts in a different order, landing either side of the truncation boundary. min and max select a stored value, so they stay exact and still catch the two paths storing different values. avg is compared within AVG_TOLERANCE, the bound validate_daily_avg already uses for the same reason. truncate_10 goes with its last caller, and an aggregate the read path leaves out now fails by name instead of as a NaN comparison. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: jgjesdal <jostein@intellistream.ai>
olavgg
approved these changes
Sep 18, 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.
Builds on #130 —
maindoes not compile without it, so this branch carries that commit too. Once #130 merges, the diff here shrinks to the one commit.test_datapoints_binaryingests the same sixty days into one series through the binary path and a twin through JSON, then requires their daily avg/min/max to match after truncating to ten decimals. It failed twice in a row on:179.9759117537160.0001581894199.9998935423179.9759117538160.0001581894199.9998935423One bucket of 60, avg only, 1e-10, with both series walked to all 5,184,000 points. A dropped or duplicated point moves a daily avg by ~1e-3. This is ClickHouse summing the two series' parts in a different order, and the truncation boundary turning a difference in the last digits into an inequality.
Change
AVG_TOLERANCE(1e-6), the boundvalidate_daily_avgalready uses for the same reason, with the rationale written beside it.truncate_10goes with its last caller, and a bucket missing an aggregate now fails by name rather than as aNaNcomparison.Passes live.
🤖 Generated with Claude Code