We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent de9703d commit f151590Copy full SHA for f151590
internal/testenv/testenv.go
@@ -7,6 +7,7 @@
7
package testenv
8
9
import (
10
+ "fmt"
11
"os"
12
"os/exec"
13
"runtime"
@@ -106,3 +107,14 @@ func NeedsGoPackagesEnv(t Testing, env []string) {
106
107
108
NeedsGoPackages(t)
109
}
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