aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/proc_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-04-20 11:06:21 -0700
committerIan Lance Taylor <iant@golang.org>2020-04-20 22:42:49 +0000
commit2edd351b92ca22581ffc75c9ff47c99bc9d9ea06 (patch)
treea6aaecccde5aede0ebeae1676b7823dd6130272e /src/runtime/proc_test.go
parent0cffc95109966c91852ff7f2b183a7f929de189b (diff)
downloadgo-2edd351b92ca22581ffc75c9ff47c99bc9d9ea06.tar.xz
runtime: skip TestBigGOMAXPROCS if it runs out of memory
Fixes #38541 Change-Id: I0e9ea5865628d953c32f3a5d4b3ccf1c1d0b081e Reviewed-on: https://go-review.googlesource.com/c/go/+/229077 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/proc_test.go')
-rw-r--r--src/runtime/proc_test.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go
index 27dba95eff..764a279fca 100644
--- a/src/runtime/proc_test.go
+++ b/src/runtime/proc_test.go
@@ -1043,8 +1043,14 @@ loop:
func TestBigGOMAXPROCS(t *testing.T) {
t.Parallel()
output := runTestProg(t, "testprog", "NonexistentTest", "GOMAXPROCS=1024")
- if strings.Contains(output, "failed to create new OS thread") {
- t.Skipf("failed to create 1024 threads")
+ // Ignore error conditions on small machines.
+ for _, errstr := range []string{
+ "failed to create new OS thread",
+ "cannot allocate memory",
+ } {
+ if strings.Contains(output, errstr) {
+ t.Skipf("failed to create 1024 threads")
+ }
}
if !strings.Contains(output, "unknown function: NonexistentTest") {
t.Errorf("output:\n%s\nwanted:\nunknown function: NonexistentTest", output)