aboutsummaryrefslogtreecommitdiff
path: root/src/testing
diff options
context:
space:
mode:
authorKatie Hockman <katie@golang.org>2021-01-13 14:43:30 -0500
committerKatie Hockman <katie@golang.org>2021-01-14 14:40:52 +0000
commit06074108fab489d6bd7358e736bcd0cb38830c7c (patch)
tree1ed64d2dba184a80b37daff30de7e6b835199f14 /src/testing
parent2f072cf8a975afb082b40cb29238ce536b5ae9b6 (diff)
downloadgo-06074108fab489d6bd7358e736bcd0cb38830c7c.tar.xz
[dev.fuzz] internal/fuzz: fix context cancellation for coordinator
Previously, performing a SIGINT would cause the coordinator to write a crash to testdata, and would continue to run despite being interupted. Also includes a few small cleanups. Change-Id: Ia3cf7cd231c30ac9ad2a61f4935aa543e241f60d Reviewed-on: https://go-review.googlesource.com/c/go/+/283634 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/internal/testdeps/deps.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/testing/internal/testdeps/deps.go b/src/testing/internal/testdeps/deps.go
index 12da4f3863..dbc30ddc0f 100644
--- a/src/testing/internal/testdeps/deps.go
+++ b/src/testing/internal/testdeps/deps.go
@@ -136,8 +136,7 @@ func (TestDeps) CoordinateFuzzing(timeout time.Duration, parallel int, seed [][]
// Fuzzing may be interrupted with a timeout or if the user presses ^C.
// In either case, we'll stop worker processes gracefully and save
// crashers and interesting values.
- ctx := context.Background()
- cancel := func() {}
+ ctx, cancel := context.WithCancel(context.Background())
if timeout > 0 {
ctx, cancel = context.WithTimeout(ctx, timeout)
}