From: Jay Conrod Date: Fri, 27 Aug 2021 20:45:32 +0000 (-0700) Subject: [dev.fuzz] internal/fuzz: count coverage-only runs toward -fuzztime X-Git-Tag: go1.18beta1~1282^2~25 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=03b8d403dc620050cf5a5ded9be6c89bcd388a70;p=gostls13.git [dev.fuzz] internal/fuzz: count coverage-only runs toward -fuzztime 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 Trust: Katie Hockman Run-TryBot: Jay Conrod TryBot-Result: Go Bot Reviewed-by: Katie Hockman --- diff --git a/src/internal/fuzz/worker.go b/src/internal/fuzz/worker.go index 290e09846b..8a5c8696de 100644 --- a/src/internal/fuzz/worker.go +++ b/src/internal/fuzz/worker.go @@ -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 {