From: Michael Anthony Knyszek Date: Thu, 19 Dec 2019 17:44:58 +0000 (+0000) Subject: runtime: disable pageAlloc tests on OpenBSD in short mode X-Git-Tag: go1.14rc1~206 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=cd1b9c1d5a7bb8ea6ebec223ce11e91897584ef4;p=gostls13.git runtime: disable pageAlloc tests on OpenBSD in short mode This change disables pageAlloc tests on OpenBSD in short mode because pageAlloc holds relatively large virtual memory reservations and we make two during the pageAlloc tests. The runtime may also be carrying one such reservation making the virtual memory requirement for testing the Go runtime three times as much as just running a Go binary. This causes problems for folks who just want to build and test Go (all.bash) on OpenBSD but either don't have machines with at least 4ish GiB of RAM (per-process virtual memory limits are capped at some constant factor times the amount of physical memory) or their per-process virtual memory limits are low for other reasons. Fixes #36210. Change-Id: I8d89cfde448d4cd2fefff4ad6ffed90de63dd527 Reviewed-on: https://go-review.googlesource.com/c/go/+/212177 Run-TryBot: Michael Knyszek TryBot-Result: Gobot Gobot Reviewed-by: Bryan C. Mills --- diff --git a/src/runtime/mgcscavenge_test.go b/src/runtime/mgcscavenge_test.go index 518d5ab27a..a6eba8d972 100644 --- a/src/runtime/mgcscavenge_test.go +++ b/src/runtime/mgcscavenge_test.go @@ -272,6 +272,9 @@ func TestPallocDataFindScavengeCandidate(t *testing.T) { // Tests end-to-end scavenging on a pageAlloc. func TestPageAllocScavenge(t *testing.T) { + if GOOS == "openbsd" && testing.Short() { + t.Skip("skipping because virtual memory is limited; see #36210") + } type test struct { request, expect uintptr } diff --git a/src/runtime/mpagealloc_test.go b/src/runtime/mpagealloc_test.go index 6c48296487..1284cad710 100644 --- a/src/runtime/mpagealloc_test.go +++ b/src/runtime/mpagealloc_test.go @@ -41,6 +41,9 @@ func checkPageAlloc(t *testing.T, want, got *PageAlloc) { } func TestPageAllocGrow(t *testing.T) { + if GOOS == "openbsd" && testing.Short() { + t.Skip("skipping because virtual memory is limited; see #36210") + } type test struct { chunks []ChunkIdx inUse []AddrRange @@ -216,6 +219,9 @@ func TestPageAllocGrow(t *testing.T) { } func TestPageAllocAlloc(t *testing.T) { + if GOOS == "openbsd" && testing.Short() { + t.Skip("skipping because virtual memory is limited; see #36210") + } type hit struct { npages, base, scav uintptr } @@ -589,6 +595,9 @@ func TestPageAllocAlloc(t *testing.T) { } func TestPageAllocExhaust(t *testing.T) { + if GOOS == "openbsd" && testing.Short() { + t.Skip("skipping because virtual memory is limited; see #36210") + } for _, npages := range []uintptr{1, 2, 3, 4, 5, 8, 16, 64, 1024, 1025, 2048, 2049} { npages := npages t.Run(fmt.Sprintf("%d", npages), func(t *testing.T) { @@ -638,6 +647,9 @@ func TestPageAllocExhaust(t *testing.T) { } func TestPageAllocFree(t *testing.T) { + if GOOS == "openbsd" && testing.Short() { + t.Skip("skipping because virtual memory is limited; see #36210") + } tests := map[string]struct { before map[ChunkIdx][]BitRange after map[ChunkIdx][]BitRange @@ -867,6 +879,9 @@ func TestPageAllocFree(t *testing.T) { } func TestPageAllocAllocAndFree(t *testing.T) { + if GOOS == "openbsd" && testing.Short() { + t.Skip("skipping because virtual memory is limited; see #36210") + } type hit struct { alloc bool npages uintptr diff --git a/src/runtime/mpagecache_test.go b/src/runtime/mpagecache_test.go index 6fdaa04d72..b8cc0bd965 100644 --- a/src/runtime/mpagecache_test.go +++ b/src/runtime/mpagecache_test.go @@ -180,6 +180,9 @@ func TestPageCacheAlloc(t *testing.T) { } func TestPageCacheFlush(t *testing.T) { + if GOOS == "openbsd" && testing.Short() { + t.Skip("skipping because virtual memory is limited; see #36210") + } bits64ToBitRanges := func(bits uint64, base uint) []BitRange { var ranges []BitRange start, size := uint(0), uint(0) @@ -254,6 +257,9 @@ func TestPageCacheFlush(t *testing.T) { } func TestPageAllocAllocToCache(t *testing.T) { + if GOOS == "openbsd" && testing.Short() { + t.Skip("skipping because virtual memory is limited; see #36210") + } tests := map[string]struct { before map[ChunkIdx][]BitRange scav map[ChunkIdx][]BitRange