diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2018-05-04 05:32:01 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2018-05-04 17:01:04 +0000 |
| commit | 8aa316c13973bae7693a8710d69a6ec452e490a1 (patch) | |
| tree | b0e90d11d90f1f1c05cc060547ebb1ee9f8ef887 /src | |
| parent | bcdbd58ce48d71cb912238caaa193d832901e227 (diff) | |
| download | go-8aa316c13973bae7693a8710d69a6ec452e490a1.tar.xz | |
cmd/dist: fix computation of test timeout
When dist test was updated to run "go test" with multiple package
arguments at once, merging the logical test units into one execution,
the hack to give cmd/go twice as much time wasn't updated.
What was happening (even in the all.bash case) was that we were
merging together, say, "cmd/go" and "bytes", and because bar was
lexically earlier, the timeout calculation was based on package "byte",
even though we were actually running, say: "go test bytes cmd/go".
This explains why x/build/cmd/release was often flaky with its
all.bash, since cmd/go can't really finish in 3 minutes reliably
unless it's running by itself. If it has any competition, it runs
over.
Change-Id: I875c8c9e65940ce0ceff48215740dfadfaa89d3f
Reviewed-on: https://go-review.googlesource.com/111395
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/dist/test.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 393af1ecd1..3bf74c8c7e 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -273,10 +273,6 @@ func (t *tester) registerStdTest(pkg string) { if t.runRx == nil || t.runRx.MatchString(testName) == t.runRxWant { stdMatches = append(stdMatches, pkg) } - timeoutSec := 180 - if pkg == "cmd/go" { - timeoutSec *= 2 - } t.tests = append(t.tests, distTest{ name: testName, heading: "Testing packages.", @@ -288,6 +284,15 @@ func (t *tester) registerStdTest(pkg string) { timelog("start", dt.name) defer timelog("end", dt.name) ranGoTest = true + + timeoutSec := 180 + for _, pkg := range stdMatches { + if pkg == "cmd/go" { + timeoutSec *= 2 + break + } + } + args := []string{ "test", "-short", |
