]> Cypherpunks repositories - gostls13.git/commit
cmd/go/testdata/script: consistently set GOCACHE in fuzz tests
authorRoland Shoemaker <roland@golang.org>
Wed, 15 Mar 2023 22:37:26 +0000 (15:37 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 16 Mar 2023 16:53:11 +0000 (16:53 +0000)
commitf594a3ec85a3bdeaa3d22bf0deb5f9d6d70d3af1
tree999250ad9b93c956bd9b76df2c18f0a5bd9ea730
parent785ab2fa65bec7fc8d244277c8962009d3a83271
cmd/go/testdata/script: consistently set GOCACHE in fuzz tests

The fuzzing cache for interesting inputs is shared across all
invocations of scripts by default. When 'go clean -fuzzcache' is called,
or fuzz targets in different scripts have the same names, we can get
race-y unexpected behavior.

Since there isn't a easy way to set just the fuzz cache directory (test
has the flag -test.fuzzcachedir, but it requires setting it on each call
to 'go test'), instead we just consistently set GOCACHE to point to a
directory in the WORK dir. As a byproduct this also prevents usage of a
shared build cache, so we see an increase in build time for these tests.

Updates #59062

Change-Id: Ie78f2943b94f3302c5bdf1f8a1e93b207853666a
Reviewed-on: https://go-review.googlesource.com/c/go/+/476755
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Roland Shoemaker <roland@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
19 files changed:
src/cmd/go/testdata/script/test_fuzz.txt
src/cmd/go/testdata/script/test_fuzz_chatty.txt
src/cmd/go/testdata/script/test_fuzz_cleanup.txt
src/cmd/go/testdata/script/test_fuzz_cov.txt
src/cmd/go/testdata/script/test_fuzz_deadline.txt
src/cmd/go/testdata/script/test_fuzz_dup_cache.txt
src/cmd/go/testdata/script/test_fuzz_fuzztime.txt
src/cmd/go/testdata/script/test_fuzz_io_error.txt
src/cmd/go/testdata/script/test_fuzz_limit_dup_entry.txt
src/cmd/go/testdata/script/test_fuzz_match.txt
src/cmd/go/testdata/script/test_fuzz_multiple.txt
src/cmd/go/testdata/script/test_fuzz_mutate_crash.txt
src/cmd/go/testdata/script/test_fuzz_mutate_fail.txt
src/cmd/go/testdata/script/test_fuzz_mutator.txt
src/cmd/go/testdata/script/test_fuzz_mutator_repeat.txt
src/cmd/go/testdata/script/test_fuzz_non_crash_signal.txt
src/cmd/go/testdata/script/test_fuzz_parallel.txt
src/cmd/go/testdata/script/test_fuzz_setenv.txt
src/cmd/go/testdata/script/test_fuzz_test_race.txt