Repository navigation
test(pack): check large-window reads without 512 MiB blobs - #172
Merged
Merged
Conversation
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: Combined Review (
|
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.
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.
maxSingleSegmentLen. A blob at the cutoff stays single-segment. A blob one byte over gets an explicit window.decodeFrameandOpenBlobboth 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, whereTestReaderRejectsOversized32BitWindowalready 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