From: Katie Hockman Date: Fri, 23 Apr 2021 18:06:51 +0000 (-0400) Subject: [dev.fuzz] cmd/go/internal/test: don't set default timeout when fuzzing X-Git-Tag: go1.18beta1~1282^2~64 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=fe8c0e9467d8628138d54951ebb8e166c086c80b;p=gostls13.git [dev.fuzz] cmd/go/internal/test: don't set default timeout when fuzzing The -timeout flag is not used when the fuzzing engine is running, but there was another backup alarm that would stop the test binary after 11 minutes by default. This change disables that backup alarm when the -fuzz flag is set. Note: unfortunately this means that if someone is running `go test -fuzz` and a test hangs before the fuzzing engine starts running, then the backup alarm won't trigger and the test will run ~forever. I don't think there's a way around this though, since the backup alarm has no way of knowing what stage of the test execution we're in (ie. are we running the unit tests, the seed corpus, or is it fuzzing). Fixes #44483 Change-Id: I4e212708a739c9cfc2e138440e27f257bb408c7f Reviewed-on: https://go-review.googlesource.com/c/go/+/313072 Trust: Katie Hockman Run-TryBot: Katie Hockman TryBot-Result: Go Bot Reviewed-by: Jay Conrod --- diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index c713394141..6c92c35360 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -618,7 +618,9 @@ func runTest(ctx context.Context, cmd *base.Command, args []string) { // to that timeout plus one minute. This is a backup alarm in case // the test wedges with a goroutine spinning and its background // timer does not get a chance to fire. - if testTimeout > 0 { + // Don't set this if fuzzing, since it should be able to run + // indefinitely. + if testTimeout > 0 && testFuzz == "" { testKillTimeout = testTimeout + 1*time.Minute }