]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: relax TestGcSys
authorRuss Cox <rsc@golang.org>
Tue, 22 May 2012 04:07:13 +0000 (00:07 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 22 May 2012 04:07:13 +0000 (00:07 -0400)
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

src/pkg/runtime/gc_test.go

index fdbe13ebbe5d896fd188bc3ccd359f2cc4042435..783409b689aaefe0f96641630527381621d6f709 100644 (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)
        }
 }