test: add CDC shift-resilient chunking tests (T-028a/b/c)#40
Merged
Conversation
Add test_cdc_buzhash_shift_resilient_prefix to directly verify that CDC boundaries do not change when a byte is inserted before the test offset. This complements existing determinism tests by asserting shift-resilient property: chunks before the insertion point remain unchanged after a 1-byte insertion, validating the core CDC guarantee used for efficient diff transfer. Use high-entropy SHA-256 block data (125 KiB) and config (min_size=512) to ensure natural boundary distribution. Cache data generation with @lru_cache to avoid redundant hash computation in future subtests (T-028b/c). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…28b/c) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
total - 3)共有ヘルパー (
_make_data(),_make_shifted(),_chunks_before_offset(),_assert_prefix_invariant()) でテスト間の重複を排除。Scope
tests/test_chunking.pyのみ (テスト5本: 既存2 + 新規3)Test plan
pytest tests/test_chunking.py -v— 5 tests passedruff check .— All checks passed🤖 Generated with Claude Code