aboutsummaryrefslogtreecommitdiff
path: root/src/internal/testenv/testenv.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/internal/testenv/testenv.go')
-rw-r--r--src/internal/testenv/testenv.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/internal/testenv/testenv.go b/src/internal/testenv/testenv.go
index 3b9d2fd1e9..9fb92406e8 100644
--- a/src/internal/testenv/testenv.go
+++ b/src/internal/testenv/testenv.go
@@ -16,6 +16,7 @@ import (
"flag"
"fmt"
"internal/cfg"
+ "internal/goarch"
"internal/platform"
"os"
"os/exec"
@@ -511,3 +512,13 @@ func WriteImportcfg(t testing.TB, dstPath string, packageFiles map[string]string
func SyscallIsNotSupported(err error) bool {
return syscallIsNotSupported(err)
}
+
+// ParallelOn64Bit calls t.Parallel() unless there is a case that cannot be parallel.
+// This function should be used when it is necessary to avoid t.Parallel on
+// 32-bit machines, typically because the test uses lots of memory.
+func ParallelOn64Bit(t *testing.T) {
+ if goarch.PtrSize == 4 {
+ return
+ }
+ t.Parallel()
+}