Skip to content

Commit 7579867

Browse files
committed
cmd/dist: allow $GO_TEST_TIMEOUT_SCALE to override timeoutScale
Some machines are so slow that even with the default timeoutScale, they still timeout some tests. For example, currently some linux/arm builders and the openbsd/arm builder are timing out the runtime test and CL 8397 was proposed to skip some tests on openbsd/arm to fix the build. Instead of increasing timeoutScale or skipping tests, this CL introduces an environment variable $GO_TEST_TIMEOUT_SCALE that could be set to manually set a larger timeoutScale for those machines/builders. Fixes #10314. Change-Id: I16c9a9eb980d6a63309e4cacd79eee2fe05769ee Reviewed-on: https://go-review.googlesource.com/9223 Reviewed-by: Brad Fitzpatrick <[email protected]>
1 parent 5c8fbc6 commit 7579867

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/cmd/dist/test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ func (t *tester) run() {
9898
if t.goarch == "arm" || t.goos == "windows" {
9999
t.timeoutScale = 2
100100
}
101+
if s := os.Getenv("GO_TEST_TIMEOUT_SCALE"); s != "" {
102+
t.timeoutScale, err = strconv.Atoi(s)
103+
if err != nil {
104+
log.Fatalf("failed to parse $GO_TEST_TIMEOUT_SCALE = %q as integer: %v", s, err)
105+
}
106+
}
101107

102108
if t.runRxStr != "" {
103109
t.runRx = regexp.MustCompile(t.runRxStr)

0 commit comments

Comments
 (0)