-
-
Notifications
You must be signed in to change notification settings - Fork 53
Detect nondeterministic tests before a mutation run #643
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestmaybeUncertain if this is a good idea, discuss before implementingUncertain if this is a good idea, discuss before implementing
Description
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestmaybeUncertain if this is a good idea, discuss before implementingUncertain if this is a good idea, discuss before implementing
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.