Skip to content

Decide the two mutants that need seams, not tests #2172

Description

@gaborbernat

Problem

Two surviving mutants need a design change to kill, not a test. Both were examined while fixing #2163 and deliberately left alone, because writing a test for either would produce a worse test than no test.

install_rustls_provider installs a process-global default exactly once. Any assertion that it installed one passes or fails depending on which test in the binary ran first, so a test asserting it would be order-dependent — the kind that goes green locally and red in CI for reasons unrelated to the change under review. Killing the mutant honestly needs a subprocess.

FlushState::reset_interval measures with std::time::Instant, which a paused Tokio clock does not move. There is no seam to drive it deterministically, so killing the mutant needs a clock abstraction in peryx-events — a design change, not a missing test.

Required change

Decide, for each, whether the seam is worth building.

For the process-global: either add a subprocess-based test, or record that this mutant is not worth killing and exclude it with the reason written beside the exclusion. A subprocess test is real work and slows the suite; saying so and declining is a legitimate outcome.

For the clock: a clock seam in peryx-events would make this and any future interval logic testable, which may be worth more than this one mutant. Weigh that against introducing an abstraction for a single caller. If the seam earns its place on its own merits, build it; if it only exists to satisfy a mutant, do not.

Whatever is decided, do not write an order-dependent test to turn a mutant green. A test that depends on execution order is worse than the gap it closes, because it fails for reasons unconnected to the code under review and trains people to rerun rather than investigate.

Acceptance criteria

  • Each of the two has a stated disposition: seam built, subprocess test added, or excluded with a written reason.
  • No test added here depends on which other test ran first.
  • If either is excluded, the exclusion names the mutant and the reason, so a later reader can re-open the decision rather than rediscover it.

Boundary

These two mutants and the seams they would need. Not the wider mutation remediation, which is #1893 and its children. If building the clock seam turns out to be worth doing for its own sake, that is a separate change and should say so.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:observabilityLogging, metrics, traces, and operational visibilityarea:testsConformance, perf tests, and observabilitypriority:P3Convenience or long-term featuretype:testTesting, conformance, metrics, or validation coverage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions