diff options
Diffstat (limited to 'src/runtime/proc_test.go')
| -rw-r--r-- | src/runtime/proc_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/runtime/proc_test.go b/src/runtime/proc_test.go index 81bcb98aeb..27dba95eff 100644 --- a/src/runtime/proc_test.go +++ b/src/runtime/proc_test.go @@ -1037,3 +1037,16 @@ loop: t.Errorf("netpollBreak did not interrupt netpoll: slept for: %v", dur) } } + +// TestBigGOMAXPROCS tests that setting GOMAXPROCS to a large value +// doesn't cause a crash at startup. See issue 38474. +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") + } + if !strings.Contains(output, "unknown function: NonexistentTest") { + t.Errorf("output:\n%s\nwanted:\nunknown function: NonexistentTest", output) + } +} |
