jepsen-io / jepsen

A framework for distributed systems verification, with fault injection
6.78k stars 714 forks source link

Replacing use of Clojure's random functions with a seedable PRNG? #578

Closed cole-miller closed 1 year ago

cole-miller commented 1 year ago

As far as I can tell, there's no way to seed the clojure.core functions for making random choices (rand-int and co., see https://clojure.atlassian.net/browse/CLJ-1452), and this is annoying if you want to hold that particular source of nondeterminism fixed when running Jepsen to increase your chances of reproducing a bug. (Of course there are various other nondeterministic inputs into a Jepsen test run.) Would you be interested in a PR that replaced Jepsen's use of these functions with a seedable PRNG?

aphyr commented 1 year ago

I don't think this would be particularly useful--the scheduler, network, and database are all nondeterministic and concurrent.

cole-miller commented 1 year ago

Ah, I guess my intuition was that having a fixed generator graph would improve reproducibility at least somewhat even in the presence of those other sources of nondeterminism -- but you'd know better than I would on that point :)