-
Notifications
You must be signed in to change notification settings - Fork 62
Add expiration to stateful test #868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f4df554 to
c155d59
Compare
8022400 to
98dfdf7
Compare
expire_snapshots to stateful test85fc37b to
876229f
Compare
| repo.lookup_snapshot(snap).written_at + timedelta(microseconds=1) | ||
| ) | ||
| with pytest.raises(ValueError): | ||
| repo.lookup_snapshot(snap) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this fails too.
c347a32 to
1e309bd
Compare
| delete_expired_tags=True, | ||
| ) | ||
| assert expired == {a, b} | ||
| assert repo.list_tags() == {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also fails.
1e309bd to
5da493d
Compare
052e2c6 to
823a46a
Compare
823a46a to
63663b1
Compare
|
OK I think this is finally done 🥳 . |
| class CommitModel: | ||
| id: str | ||
| written_at: datetime.datetime | ||
| state: dict[str, Any] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was curious about what the state was gonna be. Should we call this store?
| tag_iter = map(operator.attrgetter("commit_id"), self.tags.values()) | ||
| return itertools.chain(self.branches.values(), tag_iter) | ||
|
|
||
| def expire_snapshots( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all of this is great, but, we are re-implementing the algorithms in the tests, potentially with the same bugs we are blind to. I wonder if in the future we can define properties of the GCed or Expired repo, and try to track less in the model.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I landed up here because I'm doing an exact equality check for snapshot ids that were expired because only expires snaphsots that are reachable.
I guess I can search the "forest" and assert that set(IC expired IDs) < set(all possible expirable IDs)
* main: Fix `Diff` python typing (#890) Fail when creating Storage for Tigris using s3_compatible (#889) Disallow tag/branch creation with non-existing snapshot (#888) Log errors during listing and deleting of objects (#886) Rust integration tests can run in more object stores. (#884) Update pyo3. (#885) Add expiration to stateful test (#868)
Closes #867
Adds both
expire_snapshotsandgarbage_collect.expire_snapshotsis basically an independent reimplementation of the rust logic.garbage_collectis very simple, and only deletes expires snapshots.