I've noticed that the hash_map and hash_set strategies can be quite severe footguns. Iteration order of HashMaps and HashSets is non-deterministic. Hence, composing more strategies on top of a hash_map with .prop_flat_map will most likely yield non-deterministic behaviour and completely break the idea of reproducing a failing test case based on its seed.
I've spent many hours debugging my tests (proptest-state-machine specifically) until I finally got to the bottom of this.
I am not sure if deprecation is the right call but I think it should be called out or warned about somewhere.
I've noticed that the
hash_map
andhash_set
strategies can be quite severe footguns. Iteration order ofHashMap
s andHashSet
s is non-deterministic. Hence, composing more strategies on top of ahash_map
with.prop_flat_map
will most likely yield non-deterministic behaviour and completely break the idea of reproducing a failing test case based on its seed.I've spent many hours debugging my tests (
proptest-state-machine
specifically) until I finally got to the bottom of this.I am not sure if deprecation is the right call but I think it should be called out or warned about somewhere.