Hi all,
We'll see if this is useful, but I am starting a new thread on item 6 from here:
This might be a quick topic, or might be a meatier topic.
In this post, I will just quote what was said on item 6 in that bigger "List of possible modifications to the March 2017 proposal" thread, which was:
> -------------------------------------------------------------------
> 6. Should `go test` without `-fuzz` ever be non-deterministic?
> -------------------------------------------------------------------
>
> It seems reasonable to expect non-determinism if you explicitly ask for fuzzing, such as by supplying `-fuzz`.
>
> However, if you are just doing something like `go test .` (without a `-fuzz` flag), then any non-determinism should be carefully evaluated given people might not expect non-determinism in that situation.
>
> One example would be in a normal (non-fuzz) invocation of something like `go test ./...`. If that fails in something like travis, can you repeat that failure?
>
> There are multiple forms of non-determinism, including:
>
> 6a. Non-determinism from `rand` or similar
>
> The March 2017 proposal says:
>
> "go test runs fuzz functions as unit tests. ... Fuzz functions are executed on all inputs from the corpus and on some amount of newly generated inputs (for 1s in normal mode and for 0.1s in short mode)"
>
> If there are newly generated inputs, are those random inputs? Or deterministic in some way? Or random, but with a seed printed if there is a failure (so that the same seed can be re-used to recreate the failure if needed)?
>
> 6b. Execution time-based non-determinism
>
> If the execution time is "1s in normal mode and for 0.1s in short mode", does that mean you might get a failure on a powerful machine that does not occur within the same wall clock time on a less powerful machine?
---------------------------------------------------------------------
Romain responded:
> I would add that in this case, fuzzs will behave the same way as benchmarks: non of them are deterministic, and this is exactly why they are not the default (in addition to the time consumption thing).
Dmitry also responded:
> Provided that "go test -fuzz=. ./..." will also work (which seems to
> be what we want), then I think we better stick to simpler and safer
> deterministic load in normal "go test".
> There should be an easy way to "promote" a crashing input to a
> unit-test, e.g. by going:
> cp $GOAPTH/pkg/.../INPUT testdata/fuzz/
> and then _these_ inputs will run during normal go test.
>