-skip # Flaky: https://golang.org/issue/49047
-
# TODO(jayconrod): support shared memory on more platforms.
[!darwin] [!linux] [!windows] skip
[short] skip
-# Start fuzzing. The worker crashes after ~100 iterations.
+# Start fuzzing. The worker crashes after 100 iterations.
# The fuzz function writes the crashing input to "want" before exiting.
# The fuzzing engine reconstructs the crashing input and saves it to testdata.
! exists want
-! go test -fuzz=. -parallel=1
+! go test -fuzz=. -parallel=1 -fuzztime=110x -fuzzminimizetime=10x -v
stdout 'fuzzing process terminated unexpectedly'
stdout 'Crash written to testdata'
if i == 100 {
f, err := os.OpenFile("want", os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0666)
if err != nil {
- // Couldn't create the file, probably because it already exists,
- // and we're minimizing now. Return without crashing.
- return
+ // Couldn't create the file. Return without crashing, and try
+ // again.
+ i--
+ t.Skip(err)
+ }
+ if _, err := f.Write(b); err != nil {
+ // We already created the file, so if we failed to write it
+ // there's not much we can do. The test will fail anyway, but
+ // at least make sure the error is logged to stdout.
+ t.Fatal(err)
+ }
+ if err := f.Close(); err != nil {
+ t.Fatal(err)
}
- f.Write(b)
- f.Close()
os.Exit(1) // crash without communicating
}
return resp
}
if cov != nil {
- // Found new coverage. Before reporting to the coordinator,
- // run the same values once more to deflake.
- if !shouldStop() {
- dur, cov, errMsg = fuzzOnce(entry)
- if errMsg != "" {
- resp.Err = errMsg
- return resp
- }
- }
- if cov != nil {
- resp.CoverageData = cov
- resp.InterestingDuration = dur
- return resp
- }
+ resp.CoverageData = cov
+ resp.InterestingDuration = dur
+ return resp
}
if shouldStop() {
return resp