]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.fuzz] internal/fuzz: count coverage-only runs toward -fuzztime
authorJay Conrod <jayconrod@google.com>
Fri, 27 Aug 2021 20:45:32 +0000 (13:45 -0700)
committerJay Conrod <jayconrod@google.com>
Tue, 31 Aug 2021 17:53:48 +0000 (17:53 +0000)
When we start fuzzing, we gather baseline coverage by calling the fuzz
function with each entry in the corpus (testdata, F.Add, and
cache). These calls should count toward -fuzztime when it specifies a
limited number of calls to the fuzz function.

Change-Id: I3ff57b6d0b25e2e22bb4ce24b10f5112fb116311
Reviewed-on: https://go-review.googlesource.com/c/go/+/345769
Trust: Jay Conrod <jayconrod@google.com>
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
src/internal/fuzz/worker.go

index 290e09846b3a3e6d94617bc3e9a66f76cd639402..8a5c8696de42003732989c59827125ba4daba62d 100644 (file)
@@ -667,6 +667,7 @@ func (ws *workerServer) fuzz(ctx context.Context, args fuzzArgs) (resp fuzzRespo
        }
 
        if args.CoverageOnly {
+               mem.header().count++
                fStart := time.Now()
                err := ws.fuzzFn(CorpusEntry{Values: vals})
                if err != nil {