alunduil/zfs-replicate

Hypothesis SNAPSHOTS strategy generates distinct filesystem names

Open

#405 创建于 2026年4月23日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)Python (5 fork)auto 404
buggood first issue

仓库指标

Star
 (24 star)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南