Skip to content

TEST: fix group selection for delete#3707

Open
ianhi wants to merge 2 commits intozarr-developers:mainfrom
ianhi:fix/stateful-delete-group-precondition
Open

TEST: fix group selection for delete#3707
ianhi wants to merge 2 commits intozarr-developers:mainfrom
ianhi:fix/stateful-delete-group-precondition

Conversation

@ianhi
Copy link
Contributor

@ianhi ianhi commented Feb 12, 2026

Fix stateful test delete group precondition. This was excluding any groups at the root level, which can lead to a hypothesis error if you have these three groups /, 0, 1 because all of those were being excluded. the root group is nver in all_groups so this change should be safe to just select from all of them.

  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@github-actions github-actions bot added the needs release notes Automatically applied to PRs which haven't added release notes label Feb 12, 2026
@ianhi
Copy link
Contributor Author

ianhi commented Feb 12, 2026

small correciton. root should never be there, but nothign was explcitly disallowing. so i updated the sampling to preclude it.

@d-v-b d-v-b requested a review from dcherian February 13, 2026 08:49

@precondition(lambda self: self.store.supports_deletes)
@precondition(lambda self: len(self.all_groups) >= 2) # fixme don't delete root
@precondition(lambda self: bool(self.all_groups - {"", "/"}))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is "" in here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure the root group gets put there as "", or at least i think i remember that happening.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking again i might have been confused by this:

if self.all_groups:
parent = data.draw(st.sampled_from(sorted(self.all_groups)), label="Group parent")
else:
parent = ""

beceuase we strip the / at the start of paths i was worried that root might end up there as an empty string.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC it should be "/", so I prefer not filtering for ""

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name of the root group is the empty string "". You probably get the same thing with "/", but that's technically the root group + a separator.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so maybe we only filter for ""?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds right but please confirm what's inserted in the bundle; we should only filter for one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs release notes Automatically applied to PRs which haven't added release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants