]> Cypherpunks repositories - gostls13.git/commitdiff
runtime/debug: increase threshold on TestSetGCPercent
authorAustin Clements <austin@google.com>
Fri, 21 Apr 2017 19:42:53 +0000 (15:42 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 21 Apr 2017 19:55:14 +0000 (19:55 +0000)
Currently TestSetGCPercent checks that NextGC is within 10 MB of the
expected value. For some reason it's much noisier on some of the
builders. To get these passing again, raise the threshold to 20 MB.

Change-Id: I14e64025660d782d81ff0421c1eb898f416e11fe
Reviewed-on: https://go-review.googlesource.com/41374
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/debug/garbage_test.go

index acc781ebdc7c2ac16e6e76ea3d785587b80322a5..2110f908243007452ae1dae82fb3c07a191504a5 100644 (file)
@@ -135,7 +135,7 @@ func TestSetGCPercent(t *testing.T) {
                t.Fatalf("failed to set up baseline live heap; got %d MB, want %d MB", ms.Alloc>>20, baseline>>20)
        }
        // NextGC should be ~200 MB.
-       const thresh = 10 << 20
+       const thresh = 20 << 20 // TODO: Figure out why this is so noisy on some builders
        if want := int64(2 * baseline); abs64(want-int64(ms.NextGC)) > thresh {
                t.Errorf("NextGC = %d MB, want %d±%d MB", ms.NextGC>>20, want>>20, thresh>>20)
        }