alunduil/zfs-replicate

Hypothesis SNAPSHOTS strategy generates distinct filesystem names

Open

#405 aperta il 23 apr 2026

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Python (5 fork)auto 404
buggood first issue

Metriche repository

Star
 (24 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

User story

As a maintainer, I want the Hypothesis SNAPSHOTS strategy to generate distinct filesystem names so that the property tests that depend on it actually exercise the planner's handling of multiple filesystems.

Why

zfs_test/replicate_test/snapshot_test/strategies.py:21 reads:

_FILESYSTEMS = text(_NOT_WHITESPACE).map(lambda x: "a{x}").map(filesystem)

That's a plain string literal, not an f-string — every generated filesystem name is the literal a{x}. All tests that depend on SNAPSHOTS (generator, planner, list parser) therefore exercise a single-filesystem world and miss cross-filesystem cases. This is a silent test-quality bug.

Acceptance criteria

  • The strategy generates genuinely varied names (e.g. f"a{x}" with the text() body excluded from producing an empty string, or a more deliberate strategy composed from lists(sampled_from(...)) etc).
  • A sanity test asserts that across a Hypothesis run, at least two distinct filesystem names appear.
  • Existing property tests still pass after the fix. If any start failing, the underlying logic bug they uncover is filed as a separate issue and triaged before this issue closes.

Out of scope

  • Broader Hypothesis strategy redesign.

Notes

  • Target release: none — chore (test-only, no behavior change)
  • Good first issue — small, self-contained, testable.
  • Source: modernization assessment §1.

Guida contributor