go7.patch revision 878f9d1108230185d5eb9962a11bfaccf534b1f9
1all: disable some tests that take a long time or allocate a lot of memory.
2
3--- src/encoding/gob/encoder_test.go
4+++ src/encoding/gob/encoder_test.go
5@@ -1003,10 +1003,7 @@ func TestBadData(t *testing.T) {
6 
7 // TestHugeWriteFails tests that enormous messages trigger an error.
8 func TestHugeWriteFails(t *testing.T) {
9-	if testing.Short() {
10-		// Requires allocating a monster, so don't do this from all.bash.
11-		t.Skip("skipping huge allocation in short mode")
12-	}
13+	t.Skip("skipping test due to huge memory requirement")
14 	huge := make([]byte, tooBig)
15 	huge[0] = 7 // Make sure it's not all zeros.
16 	buf := new(bytes.Buffer)
17--- src/math/big/float_test.go
18+++ src/math/big/float_test.go
19@@ -1428,10 +1428,7 @@ func TestFloatQuo(t *testing.T) {
20 // TestFloatQuoSmoke tests all divisions x/y for values x, y in the range [-n, +n];
21 // it serves as a smoke test for basic correctness of division.
22 func TestFloatQuoSmoke(t *testing.T) {
23-	n := 1000
24-	if testing.Short() {
25-		n = 10
26-	}
27+	n := 10
28 
29 	const dprec = 3         // max. precision variation
30 	const prec = 10 + dprec // enough bits to hold n precisely
31--- src/math/big/rat_test.go
32+++ src/math/big/rat_test.go
33@@ -430,10 +430,7 @@ func TestFloat64Distribution(t *testing.T) {
34 		9,
35 		11,
36 	}
37-	var winc, einc = uint64(1), 1 // soak test (~75s on x86-64)
38-	if testing.Short() {
39-		winc, einc = 10, 500 // quick test (~12ms on x86-64)
40-	}
41+	var winc, einc = uint64(10), 500
42 
43 	for _, sign := range "+-" {
44 		for _, a := range add {
45--- src/math/big/ratconv_test.go
46+++ src/math/big/ratconv_test.go
47@@ -344,9 +344,7 @@ func isFinite(f float64) bool {
48 func TestFloat32SpecialCases(t *testing.T) {
49 	for _, input := range float64inputs {
50 		if strings.HasPrefix(input, "long:") {
51-			if testing.Short() {
52-				continue
53-			}
54+			continue
55 			input = input[len("long:"):]
56 		}
57 
58@@ -400,9 +398,7 @@ func TestFloat32SpecialCases(t *testing.T) {
59 func TestFloat64SpecialCases(t *testing.T) {
60 	for _, input := range float64inputs {
61 		if strings.HasPrefix(input, "long:") {
62-			if testing.Short() {
63-				continue
64-			}
65+			continue
66 			input = input[len("long:"):]
67 		}
68 
69--- src/net/dial_test.go
70+++ src/net/dial_test.go
71@@ -77,10 +77,7 @@ func TestSelfConnect(t *testing.T) {
72 	l.Close()
73 
74 	// Try to connect to that address repeatedly.
75-	n := 100000
76-	if testing.Short() {
77-		n = 1000
78-	}
79+	n := 1000
80 	switch runtime.GOOS {
81 	case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd", "plan9", "solaris", "windows":
82 		// Non-Linux systems take a long time to figure
83--- src/runtime/fastlog2_test.go
84+++ src/runtime/fastlog2_test.go
85@@ -16,11 +16,7 @@ func TestFastLog2(t *testing.T) {
86 	const randomBitCount = 26
87 	var e float64
88 
89-	inc := 1
90-	if testing.Short() {
91-		// Check 1K total values, down from 64M.
92-		inc = 1 << 16
93-	}
94+	inc := 1 << 16
95 	for i := 1; i < 1<<randomBitCount; i += inc {
96 		l, fl := math.Log2(float64(i)), runtime.Fastlog2(float64(i))
97 		d := l - fl
98--- src/runtime/hash_test.go
99+++ src/runtime/hash_test.go
100@@ -126,9 +126,7 @@ func TestSmhasherZeros(t *testing.T) {
101 
102 // Strings with up to two nonzero bytes all have distinct hashes.
103 func TestSmhasherTwoNonzero(t *testing.T) {
104-	if testing.Short() {
105-		t.Skip("Skipping in short mode")
106-	}
107+	t.Skip("skipping test due to huge memory requirement")
108 	h := newHashSet()
109 	for n := 2; n <= 16; n++ {
110 		twoNonZero(h, n)
111@@ -229,9 +227,7 @@ func setbits(h *HashSet, b []byte, i int, k int) {
112 // Test all possible combinations of n blocks from the set s.
113 // "permutation" is a bad name here, but it is what Smhasher uses.
114 func TestSmhasherPermutation(t *testing.T) {
115-	if testing.Short() {
116-		t.Skip("Skipping in short mode")
117-	}
118+	t.Skip("skipping test due to huge memory requirement")
119 	permutation(t, []uint32{0, 1, 2, 3, 4, 5, 6, 7}, 8)
120 	permutation(t, []uint32{0, 1 << 29, 2 << 29, 3 << 29, 4 << 29, 5 << 29, 6 << 29, 7 << 29}, 8)
121 	permutation(t, []uint32{0, 1}, 20)
122--- src/runtime/pprof/pprof_test.go
123+++ src/runtime/pprof/pprof_test.go
124@@ -257,14 +257,7 @@ func profileOk(t *testing.T, need []string, prof bytes.Buffer, duration time.Dur
125 func TestCPUProfileWithFork(t *testing.T) {
126 	testenv.MustHaveExec(t)
127 
128-	heap := 1 << 30
129-	if runtime.GOOS == "android" {
130-		// Use smaller size for Android to avoid crash.
131-		heap = 100 << 20
132-	}
133-	if testing.Short() {
134-		heap = 100 << 20
135-	}
136+	heap := 100 << 20
137 	// This makes fork slower.
138 	garbage := make([]byte, heap)
139 	// Need to touch the slice, otherwise it won't be paged in.
140