Open axch opened 9 years ago
Why don't we just use a fixed random seed (e.g., zero) for tests, and chain it when we iterate a test multiple times? Then it's always reproducible.
You mean, reset the seed to 0 at the beginning of each distinct test? That's actually not a bad idea. I mildly prefer Jenkins to be exploring different initial seeds over its many runs of any one test, but reproducibility probably trumps that.
Speaking of which, it doesn't have to be 0, but can still be shared across all tests within a single test run, which the test suite can report at the end (and/or the beginning).
Zero is easier to remember and requires zero work to integrate it with our debugging capacity.
The point of chaining it when iterating a test multiple times is so that we can explore more of the space at the expense of time in long quality tests.
Although maybe in the latter case it would nonetheless be worthwhile to report the state before each new trial.
@riastradh-probcomp recently wrote a related concept for Bayeslite, called, if I recall, @stochastic
. The architecture is that the test function is expected to accept a seed
argument, given which it is to be deterministic; the test framework (via the @stochastic
annotation) will take care to run the test with various seeds, emit them in the event of failure, and permit the operator to reproduce a given seed run at will.
@stochasticTest
has been written and widely incorporated in August 2016; remaining task sufficient to close this ticket is to grep the test suite for get_ripl()
(424 results as of this writing) and tag those tests @stochasticTest
, or manually confirm that they are not, in fact, stochastic.
This depends on #138. Given that, could instrument, say, get_ripl or statisticalTest to