Skip to content

Commit d864eac

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
cmd/go: limit GOMAXPROCS in TestScript/test_fuzz_.*
This limits the throughput and resource consumption of the fuzz workers in the tests, which also reduces the likelihood of running out of address space in the fuzz coordinator during the test. (Ideally the coordinator should not be limited by address space; this just works around the failure mode in the tests for now.) For #65434. Change-Id: I3086c6278d6803a3dbf17a46ed01b68cedc92ad9 Cq-Include-Trybots: luci.golang.try:gotip-linux-386-longtest,gotip-windows-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/560515 Reviewed-by: Roland Shoemaker <[email protected]> Auto-Submit: Bryan Mills <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 3b0d39c commit d864eac

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/cmd/go/testdata/script/test_fuzz_deadline.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
[short] skip
33
env GOCACHE=$WORK/cache
44

5+
# Warm up the build cache with GOMAXPROCS unrestricted.
6+
go test -c -o $devnull
7+
8+
# For the fuzzing phase, we reduce GOMAXPROCS to avoid consuming too many
9+
# resources during the test. Ideally this would just free up resources to run
10+
# other parallel tests more quickly, but unfortunately it is actually necessary
11+
# in some 32-bit environments to prevent the fuzzing engine from running out of
12+
# address space (see https://go.dev/issue/65434).
13+
env GOMAXPROCS=2
14+
515
# The fuzz function should be able to detect whether -timeout
616
# was set with T.Deadline. Note there is no F.Deadline, and
717
# there is no timeout while fuzzing, even if -fuzztime is set.

src/cmd/go/testdata/script/test_fuzz_fuzztime.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ env GOCACHE=$WORK/cache
55
# There are no seed values, so 'go test' should finish quickly.
66
go test
77

8+
# For the fuzzing phase, we reduce GOMAXPROCS to avoid consuming too many
9+
# resources during the test. Ideally this would just free up resources to run
10+
# other parallel tests more quickly, but unfortunately it is actually necessary
11+
# in some 32-bit environments to prevent the fuzzing engine from running out of
12+
# address space (see https://go.dev/issue/65434).
13+
env GOMAXPROCS=2
14+
815
# Fuzzing should exit 0 after fuzztime, even if timeout is short.
916
go test -timeout=3s -fuzz=FuzzFast -fuzztime=5s
1017

0 commit comments

Comments
 (0)