]> Cypherpunks repositories - gostls13.git/commit
[dev.fuzz] testing: support T.Parallel in fuzz functions
authorJay Conrod <jayconrod@google.com>
Wed, 10 Mar 2021 16:11:59 +0000 (11:11 -0500)
committerJay Conrod <jayconrod@google.com>
Fri, 9 Apr 2021 19:52:06 +0000 (19:52 +0000)
commitb2b6be71f27ef74510394dad822cfe8d5e56f4f4
tree1ca904318f643304e26fd38ce1afdf551de15729
parent4baa39ca22c34d4c224ac69da644c85dee196474
[dev.fuzz] testing: support T.Parallel in fuzz functions

While running the seed corpus, T.Parallel acts like it does in
subtests started with T.Run: it blocks until all other non-parallel
subtests have finished, then unblocks when the barrier chan is
closed. A semaphore (t.context.waitParallel) limits the number of
tests that run concurrently (determined by -test.parallel).

While fuzzing, T.Parallel has no effect, other than asserting that it
can't be called multiple times. We already run different inputs in
concurrent processes, but we can't run inputs concurrently in the same
process if we want to attribute crashes to specific inputs.

Change-Id: I2bac08e647e1d92ea410c83c3f3558a033fe3dd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/300449
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Katie Hockman <katie@golang.org>
src/cmd/go/testdata/script/test_fuzz_parallel.txt [new file with mode: 0644]
src/internal/fuzz/worker.go
src/testing/fuzz.go
src/testing/sub_test.go
src/testing/testing.go