testing: clarify -timeout flag

Fixes #20090

Change-Id: I881607e55cd946a703e74a7d8ae2bbde67546510
Reviewed-on: https://go-review.googlesource.com/45816
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Kale Blankenship 2017-06-14 20:11:21 -07:00 committed by Brad Fitzpatrick
parent 58ce43baaa
commit e7c650bca5
3 changed files with 7 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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")