Skip to content

test(pack): check large-window reads without 512 MiB blobs - #172

Merged
mariusvniekerk merged 1 commit into
mainfrom
test/pack-small-oversized-frame-tests
Oct 8, 2026
Merged

mariusvniekerk merged 1 commit into
mainfrom
test/pack-small-oversized-frame-tests

Conversation

@mariusvniekerk

Copy link
Copy Markdown
Contributor

The tests from #163 for blobs larger than 512 MiB built real payloads of that size. One needed about 1.6 GB of memory in every ordinary CI run, on all three operating systems. To limit that cost, the file was excluded from race builds, so the race detector never ran these tests. This change improves the developer experience: it replaces those tests with ones that use small data, need little memory, and also run under the race detector.

  • Encoder: the test lowers the single-segment cutoff to 64 KiB. The cutoff is now a package variable, maxSingleSegmentLen. A blob at the cutoff stays single-segment. A blob one byte over gets an explicit window.
  • Reader: the test takes a 1 MiB single-segment frame and changes its header to claim 512 MiB + 1. decodeFrame and OpenBlob both check the window against that header before they decode. So the test shows that they accept the frame, without allocating 512 MiB. It skips on 32-bit, where TestReaderRejectsOversized32BitWindow already covers the 512 MiB cap.

Tradeoff: no test now decodes a real blob over 512 MiB from end to end. I reverted each of the three parts of the #163 fix in turn: the single-segment cutoff, the buffered decoder's window, and the default streaming window. Each revert makes the matching test fail.

generated by a clanker

The tests for blobs larger than 512 MiB built real payloads of that size.
One needed about 1.6 GB of memory in every ordinary CI run. Because of
that cost, the file was excluded from race builds, so the race job never
ran these tests.

The tests now use small data. The encoder test lowers the single-segment
cutoff to 64 KiB and checks both sides of it. The reader test takes a
small single-segment frame and changes its header to claim just over
512 MiB. Both read paths check the window against that header before
they decode, so the test proves they accept it without allocating the
blob. Each test fails if its part of the fix is reverted.

The tests no longer decode a real blob over 512 MiB from end to end.

Generated with Claude Code (claude-opus-5-5)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@roborev-ci

roborev-ci Bot commented Oct 8, 2026

Copy link
Copy Markdown

roborev: Combined Review (3ed9fae)

Verdict: No findings at or above medium severity.


Reviewers: 2x codex, codex (security) | Synthesis: codex, 9s | Total: 2m54s

@mariusvniekerk
mariusvniekerk merged commit 890a327 into main Oct 8, 2026
9 checks passed
@mariusvniekerk
mariusvniekerk deleted the test/pack-small-oversized-frame-tests branch October 8, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant