aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorKatie Hockman <katie@golang.org>2020-12-01 17:37:07 -0500
committerFilippo Valsorda <filippo@golang.org>2020-12-04 19:17:29 +0100
commitdb514c0caf5effb4396c9746e025c1ba2d717604 (patch)
treef4a6b79b5bc6a82b6ec54ec37c2ceaf9cf5345ab /src/testing
parenta01814975c18ff1a63847eb82e0a57f7c3c746e5 (diff)
downloadgo-db514c0caf5effb4396c9746e025c1ba2d717604.tar.xz
[dev.fuzz] testing: fix duplicate logging when fuzzing
The workers were printing PASS/FAIL logs and various others things, when that should be the sole responsibility of the coordinator process, which will have the aggregated data. Change-Id: I7ac9883db62f0fe79ba1799cb88773c542a2a948 Reviewed-on: https://go-review.googlesource.com/c/go/+/274652 Trust: Katie Hockman <katie@golang.org> Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/fuzz.go7
-rw-r--r--src/testing/testing.go6
2 files changed, 10 insertions, 3 deletions
diff --git a/src/testing/fuzz.go b/src/testing/fuzz.go
index 100075ca2c..5f65f8a395 100644
--- a/src/testing/fuzz.go
+++ b/src/testing/fuzz.go
@@ -191,6 +191,9 @@ func (f *F) Fuzz(ff interface{}) {
}
func (f *F) report() {
+ if *isFuzzWorker {
+ return
+ }
if f.Failed() {
fmt.Fprintf(f.w, "--- FAIL: %s\n%s\n", f.name, f.result.String())
} else if f.chatty != nil {
@@ -357,7 +360,9 @@ func runFuzzing(deps testDeps, fuzzTargets []InternalFuzzTarget) (ran, ok bool)
}
if Verbose() {
f.chatty = newChattyPrinter(f.w)
- f.chatty.Updatef(f.name, "--- FUZZ: %s\n", f.name)
+ if !*isFuzzWorker {
+ f.chatty.Updatef(f.name, "--- FUZZ: %s\n", f.name)
+ }
}
go f.runTarget(target.Fn)
<-f.signal
diff --git a/src/testing/testing.go b/src/testing/testing.go
index f44b7ca7a5..8b4f55215b 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -1441,14 +1441,16 @@ func (m *M) Run() (code int) {
if *matchFuzz != "" && !fuzzingRan {
fmt.Fprintln(os.Stderr, "testing: warning: no targets to fuzz")
}
- if !fuzzingOk {
+ if !fuzzingOk && !*isFuzzWorker {
fmt.Println("FAIL")
m.exitCode = 1
return
}
- fmt.Println("PASS")
m.exitCode = 0
+ if !*isFuzzWorker {
+ fmt.Println("PASS")
+ }
return
}