! go test -run=FuzzMutate -fuzz=FuzzMutate
exists testdata/fuzz/FuzzMutate
+# Testdata should now contain a corpus entry which will fail FuzzMutate.
+# Run the test without fuzzing, setting -parallel to different values to make
+# sure it fails, and doesn't hang.
+! go test -run=FuzzMutate -parallel=1
+! go test -run=FuzzMutate -parallel=2
+! go test -run=FuzzMutate -parallel=4
+
-- go.mod --
module fuzz_parallel
for _, v := range e.Values {
args = append(args, reflect.ValueOf(v))
}
- // Before reseting the current coverage, defer the snapshot so that we
- // make sure it is called right before the tRunner function exits,
- // regardless of whether it was executed cleanly, panicked, or if the
- // fuzzFn called t.Fatal.
+ // Before resetting the current coverage, defer the snapshot so that
+ // we make sure it is called right before the tRunner function
+ // exits, regardless of whether it was executed cleanly, panicked,
+ // or if the fuzzFn called t.Fatal.
defer f.fuzzContext.deps.SnapshotCoverage()
f.fuzzContext.deps.ResetCoverage()
fn.Call(args)
// This only affects fuzz tests run as normal tests.
// While fuzzing, T.Parallel has no effect, so f.sub is empty, and this
// branch is not taken. f.barrier is nil in that case.
+ f.testContext.release()
close(f.barrier)
// Wait for the subtests to complete.
for _, sub := range f.sub {