]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: disable pageAlloc tests on OpenBSD in short mode
authorMichael Anthony Knyszek <mknyszek@google.com>
Thu, 19 Dec 2019 17:44:58 +0000 (17:44 +0000)
committerMichael Knyszek <mknyszek@google.com>
Thu, 26 Dec 2019 21:16:03 +0000 (21:16 +0000)
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 <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/runtime/mgcscavenge_test.go
src/runtime/mpagealloc_test.go
src/runtime/mpagecache_test.go

index 518d5ab27ae5f0748ef12ec06504ceee47efed6f..a6eba8d972cb8affc0ab30323d0d28b659dcf82c 100644 (file)
@@ -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
        }
index 6c48296487e2add89e06368804c90a107a3bd5d7..1284cad71063b57ca28b9e7215400b1b87a38a51 100644 (file)
@@ -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
index 6fdaa04d726d301dd2220585386c4f0dc2693723..b8cc0bd965f5924941f4fb2041dc8a477ff0e7ad 100644 (file)
@@ -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