From: Kale Blankenship Date: Thu, 15 Jun 2017 03:11:21 +0000 (-0700) Subject: testing: clarify -timeout flag X-Git-Tag: go1.9beta2~78 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=e7c650bca5fc7a8161527924bc7cb889fb8ab5e0;p=gostls13.git testing: clarify -timeout flag Fixes #20090 Change-Id: I881607e55cd946a703e74a7d8ae2bbde67546510 Reviewed-on: https://go-review.googlesource.com/45816 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index 745ee31d99..8a5aa5bf4f 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -1489,8 +1489,9 @@ // the Go tree can run a sanity check but not spend time running // exhaustive tests. // -// -timeout t -// If a test runs longer than t, panic. +// -timeout d +// If the cumulative test time for a package runs longer than +// duration d, panic. Timeout is disabled if set to 0. // The default is 10 minutes (10m). // // -v diff --git a/src/cmd/go/internal/test/test.go b/src/cmd/go/internal/test/test.go index 8cffa14a1c..3575cad204 100644 --- a/src/cmd/go/internal/test/test.go +++ b/src/cmd/go/internal/test/test.go @@ -214,8 +214,9 @@ const testFlag2 = ` the Go tree can run a sanity check but not spend time running exhaustive tests. - -timeout t - If a test runs longer than t, panic. + -timeout d + If the cumulative test time for a package runs longer than + duration d, panic. Timeout is disabled if set to 0. The default is 10 minutes (10m). -v diff --git a/src/testing/testing.go b/src/testing/testing.go index dbe9089fb5..fa6c36c6d3 100644 --- a/src/testing/testing.go +++ b/src/testing/testing.go @@ -265,7 +265,7 @@ var ( mutexProfile = flag.String("test.mutexprofile", "", "write a mutex contention profile to the named file after execution") mutexProfileFraction = flag.Int("test.mutexprofilefraction", 1, "if >= 0, calls runtime.SetMutexProfileFraction()") traceFile = flag.String("test.trace", "", "write an execution trace to `file`") - timeout = flag.Duration("test.timeout", 0, "fail test binary execution after duration `d` (0 means unlimited)") + timeout = flag.Duration("test.timeout", 0, "panic test binary after duration `d` (0 means unlimited)") cpuListStr = flag.String("test.cpu", "", "comma-separated `list` of cpu counts to run each test with") parallel = flag.Int("test.parallel", runtime.GOMAXPROCS(0), "run at most `n` tests in parallel")