Skip to content

Commit f151590

Browse files
author
Bryan C. Mills
committed
all: skip more memory-intensive tests on linux-arm
Updates golang/go#32834 Change-Id: I9844dc09d9a6eb2e79a0b28a1e69ed018bfa1bff Reviewed-on: https://go-review.googlesource.com/c/tools/+/192578 Run-TryBot: Bryan C. Mills <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent de9703d commit f151590

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

internal/testenv/testenv.go

+12
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
package testenv
88

99
import (
10+
"fmt"
1011
"os"
1112
"os/exec"
1213
"runtime"
@@ -106,3 +107,14 @@ func NeedsGoPackagesEnv(t Testing, env []string) {
106107

107108
NeedsGoPackages(t)
108109
}
110+
111+
// ExitIfSmallMachine emits a helpful diagnostic and calls os.Exit(0) if the
112+
// current machine is a builder known to have scarce resources.
113+
//
114+
// It should be called from within a TestMain function.
115+
func ExitIfSmallMachine() {
116+
if os.Getenv("GO_BUILDER_NAME") == "linux-arm" {
117+
fmt.Fprintln(os.Stderr, "skipping test: linux-arm builder lacks sufficient memory (https://golang.org/issue/32834)")
118+
os.Exit(0)
119+
}
120+
}

0 commit comments

Comments
 (0)