tests: cover the extent-dedupe path; hoist sync() to the harness - #17
Merged
Conversation
The dedupe tests all use identical files, which take the whole-file dedupe path and never reach fiemap_scan_extent()/fiemap_count_shared() (rewritten recently). Add test_extent_dedupe: two files with distinct heads and an identical, separately-extented tail, so only the extent pass can share them. It checks the tail gets shared, data is preserved, and a second pass adds no new sharing. (It can't pin the exact post-dedupe offset - that's only a hint, and the kernel byte-verifies every dedupe - so it guards the path against crashes and sharing/data regressions.) Four test files had a copy-pasted `_sync()`; this would have been the fifth. Hoist it to the harness as `sync()` and drop the local copies (and now-unused subprocess imports). Co-Authored-By: Claude Fable 5 <[email protected]>
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
@requires_reflinkdedupe tests all use identical files → whole-file dedupe, never reachingfiemap_scan_extent()/fiemap_count_shared()(the functions markfasheh#402/#14/#15 rewrote). Addstest_extent_dedupe.py: two files with distinct heads and an identical, separately-extented tail, so only the extent pass can share them. Asserts the tail is shared, data is preserved, and a second pass adds no new sharing.Honest scope: it can't pin
fiemap_scan_extent()'s exact post-dedupe offset — that value is only a hint for the "already-deduped" check, and the kernel byte-verifies every dedupe, so a wrong hint changes neither data nor sharing. It guards the path against crashes and sharing/data regressions (previously zero coverage)./simplify: the review flagged that_sync()was now copy-pasted across four test files — hoisted it to the harness assync()and dropped the local copies + unused imports. 43 tests pass.🤖 Generated with Claude Code