Open
Conversation
Add icechunk.testing.stateful_subsets with a test_subsets() function that runs a Hypothesis state machine with only a subset of rules enabled. Uses __wrapped__ to strip @rule markers while keeping the method implementation intact. Use it to add test_gc_with_rules, which runs VersionControlStateMachine with only the 6 GC-relevant rules, reliably catching the expire_v2 orphan parent bug. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When expire_v2 removed an intermediate snapshot whose child was unreachable from any ref (e.g. after reset_branch), the child's parent_id was set to None instead of INITIAL_SNAPSHOT_ID. Fix new_parent to fall back to INITIAL_SNAPSHOT_ID for unreachable snapshots, matching the pattern from PR #1708 for garbage_collect. Add two focused expire tests that reliably catch this bug: - test_expire_subset: uses test_subsets with empty_commit rule - ExpireOrphanTest: standalone minimal state machine Also fix .add(generator) bug in expire_snapshots rule (should be .update), and add __wrapped__ guard in strip_rule. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
Lets do (2) |
dcherian
reviewed
Mar 31, 2026
| None | ||
| // Snapshot not reachable from any ref (e.g. branch was reset away). | ||
| // Re-parent to the initial snapshot rather than orphaning with None. | ||
| Some(Snapshot::INITIAL_SNAPSHOT_ID) |
Collaborator
There was a problem hiding this comment.
In #1932 i change the expectation so we assert that ancestry ends at a node with parent_id == None.
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.
I added two versions of stateful tests that catch #1931
A subset of our existing test
pro: no new tests
con: had to add a new commit method and bunch of complicated hypothesis subset machinery
a. smaller GC focused statemachine
pro: catches bug very fast
con: adds another stateful test
we should chose which one we want and then I'll remove the other.