Skip to content

Strengthen test ownership and RowBinary boundary safety - #410

Open
ruslandoga wants to merge 2 commits into
masterfrom
rd/audit-ch-test-structure
Open

Strengthen test ownership and RowBinary boundary safety#410
ruslandoga wants to merge 2 commits into
masterfrom
rd/audit-ch-test-structure

Conversation

@ruslandoga

@ruslandoga ruslandoga commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add wide SELECT and RowBinary INSERT matrices for heterogeneous composition coverage
  • move exhaustive integer, decimal, string, and connection contracts to focused owner modules
  • split incremental RowBinary decoding into independent async modules
  • add adversarial boundary and property tests derived from each fixed-width encoder
  • validate values before bitstring construction so overflow cannot silently wrap
  • escape and parse hostile Enum labels losslessly

Corruption and robustness fixes

The new tests exposed and fix several cases beyond the originally reported Decimal issue:

  • Decimal32/64/128/256 coefficients could wrap at their signed storage width
  • scaling and rounding could introduce unchecked Decimal overflow
  • declared Decimal precision and scale were not enforced for RowBinary
  • non-finite Decimals raised incidental arithmetic errors
  • Float32 overflow encoded infinity, which decoded as nil
  • Date and DateTime values wrapped their UInt16/UInt32 storage
  • DateTime64 ticks could overflow Int64
  • IPv6 segments silently truncated; invalid IPv4 octets returned invalid iodata
  • Enum labels containing quotes, backslashes, delimiters, controls, or NUL were not escaped or decoded correctly
  • invalid/duplicate Enum mappings and invalid Decimal definitions were accepted

Adversarial coverage

  • generated signed bit patterns for every Decimal storage width
  • min/max and one-past-boundary cases
  • scaling, rounding, precision, exponent, and non-finite Decimal cases
  • Float32/Float64 overflow cases
  • Date, DateTime, and DateTime64 storage boundaries
  • generated IPv4 octets and every IPv6 segment bit pattern
  • generated Enum type round-trips with quotes, backslashes, punctuation, whitespace, control bytes, Unicode, and NUL
  • live ClickHouse Enum insert/select through escaped RowBinary type headers

Testing

  • MIX_ENV=test mix format --check-formatted
  • MIX_ENV=test mix compile --warnings-as-errors
  • git diff --check
  • MIX_ENV=test mix test --include slow --max-cases 8

Result: 484 passed (171 doctests, 37 properties, 276 tests).

@ruslandoga ruslandoga changed the title Refine integration test ownership and parallelism Strengthen test ownership and RowBinary boundary safety Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant