Skip to content

Detect nondeterministic tests before a mutation run #643

Description

@adriendellagaspera

cargo-mutants assumes the test suite is deterministic. In practice it's often not: unseeded proptest/quickcheck or rand::random(), tests binding a fixed port or using wall-clock time... With this, the same mutant can show MISSED on one run and CAUGHT on the next, and you only notice after a full run, which can take long.

Idea: these tests are always fixable upstream, and cargo-mutants could help catch them (cheaply). A preflight check (like cargo mutants doctor, or a flag) could scan for these patterns before running, and warn or refuse to run.
It could be static (grep/AST for proptest! without a seed, rand::random, fixed-port binds etc.), or a runtime check (run the baseline suite twice and diff the results), or both.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestmaybeUncertain if this is a good idea, discuss before implementing

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions