From 03b8d403dc620050cf5a5ded9be6c89bcd388a70 Mon Sep 17 00:00:00 2001 From: Jay Conrod Date: Fri, 27 Aug 2021 13:45:32 -0700 Subject: [PATCH] [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 --- src/internal/fuzz/worker.go | 1 + 1 file changed, 1 insertion(+) 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 { -- 2.51.0