]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: allow $GO_TEST_TIMEOUT_SCALE to override timeoutScale
authorShenghou Ma <minux@golang.org>
Thu, 23 Apr 2015 06:16:31 +0000 (02:16 -0400)
committerMinux Ma <minux@golang.org>
Fri, 24 Apr 2015 05:45:36 +0000 (05:45 +0000)
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 <bradfitz@golang.org>
src/cmd/dist/test.go

index 559e5aaf3a4d1d0cbf6f7c12cdea951357a05ffb..0479fd50eca9d0b6b1e823cc8d6deb5f7b7ef11f 100644 (file)
@@ -98,6 +98,12 @@ func (t *tester) run() {
        if t.goarch == "arm" || t.goos == "windows" {
                t.timeoutScale = 2
        }
+       if s := os.Getenv("GO_TEST_TIMEOUT_SCALE"); s != "" {
+               t.timeoutScale, err = strconv.Atoi(s)
+               if err != nil {
+                       log.Fatalf("failed to parse $GO_TEST_TIMEOUT_SCALE = %q as integer: %v", s, err)
+               }
+       }
 
        if t.runRxStr != "" {
                t.runRx = regexp.MustCompile(t.runRxStr)