1
0
mirror of https://github.com/golang/go synced 2024-11-25 09:47:57 -07:00

runtime: relax TestGcSys

This fixes occasional 64-bit failures.
Maybe it will fix the 32-bit failures too,
so re-enable on 32-bit for now.

R=golang-dev, bradfitz, r, dvyukov
CC=golang-dev
https://golang.org/cl/6218050
This commit is contained in:
Russ Cox 2012-05-22 00:07:13 -04:00
parent 875f34fd49
commit 85266dfd4d

View File

@ -10,11 +10,6 @@ import (
)
func TestGcSys(t *testing.T) {
if runtime.GOARCH != "amd64" {
// TODO(adg): remove this when precise gc is implemented
t.Logf("skipping on non-amd64 systems")
return
}
memstats := new(runtime.MemStats)
runtime.GC()
runtime.ReadMemStats(memstats)
@ -31,6 +26,7 @@ func TestGcSys(t *testing.T) {
}
// Should only be using a few MB.
// We allocated 100 MB or (if not short) 1 GB.
runtime.ReadMemStats(memstats)
if sys > memstats.Sys {
sys = 0
@ -38,7 +34,7 @@ func TestGcSys(t *testing.T) {
sys = memstats.Sys - sys
}
t.Logf("used %d extra bytes", sys)
if sys > 4<<20 {
if sys > 16<<20 {
t.Fatalf("using too much memory: %d bytes", sys)
}
}