aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorJay Conrod <jayconrod@google.com>2021-03-19 15:11:29 -0400
committerJay Conrod <jayconrod@google.com>2021-04-09 19:50:15 +0000
commit4cde035a720448b2bca07ecdc12beef3b1322939 (patch)
tree058b2544c3b88092b3b53133163e501efe99568b /src/testing
parentb178a81e1f95eea38893e6da8daa3260d3e601de (diff)
downloadgo-4cde035a720448b2bca07ecdc12beef3b1322939.tar.xz
[dev.fuzz] internal/fuzz: improve cancellation in worker event loops
worker.runFuzzing now accepts a Context, used for cancellation instead of doneC (which is removed). This is passed down through workerClient RPC methods (ping, fuzz). workerClient RPC methods now wrap the call method, which handles marshaling and cancellation. Both workerClient.call and workerServer.serve should return quickly when their contexts are cancelled. Turns out, closing the pipe won't actually unblock a read on all platforms. Instead, we were falling back to SIGKILL in worker.stop, which works but takes longer than necessary. Also fixed missing newline in log message. Change-Id: I7b5ae54d6eb9afd6361a07759f049f048952e0cc Reviewed-on: https://go-review.googlesource.com/c/go/+/303429 Trust: Jay Conrod <jayconrod@google.com> Trust: Katie Hockman <katie@golang.org> Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Katie Hockman <katie@golang.org>
Diffstat (limited to 'src/testing')
-rw-r--r--src/testing/fuzz.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/testing/fuzz.go b/src/testing/fuzz.go
index 2a0754fdd7..73ac59cfb4 100644
--- a/src/testing/fuzz.go
+++ b/src/testing/fuzz.go
@@ -362,7 +362,7 @@ func (f *F) Fuzz(ff interface{}) {
if err != nil {
f.result = FuzzResult{Error: err}
f.Fail()
- fmt.Fprintf(f.w, "%v", err)
+ fmt.Fprintf(f.w, "%v\n", err)
if crashErr, ok := err.(fuzzCrashError); ok {
crashName := crashErr.CrashName()
fmt.Fprintf(f.w, "Crash written to %s\n", filepath.Join("testdata/corpus", f.name, crashName))