]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix TestGcLastTime on windows
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 19 Aug 2014 15:32:27 +0000 (19:32 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 19 Aug 2014 15:32:27 +0000 (19:32 +0400)
Intended to fix:
http://build.golang.org/log/d6718ea67541b8c6be2bb14bcbc4e1c4261f67d7

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews
https://golang.org/cl/127520043

src/pkg/runtime/gc_test.go

index 383af5be3ddbd5dfc4780205f01a3df11ea5f1db..816fc89b0471c8801615546661d2b108e684785d 100644 (file)
@@ -165,7 +165,8 @@ func TestGcLastTime(t *testing.T) {
                t.Fatalf("bad last GC time: got %v, want [%v, %v]", last, t0, t1)
        }
        pause := ms.PauseNs[(ms.NumGC+255)%256]
-       if pause == 0 || pause > 10e9 {
+       // Due to timer granularity pause can actually be 0 on windows.
+       if (pause == 0 && runtime.GOOS != "windows") || pause > 10e9 {
                t.Fatalf("bad last GC pause: got %v, want [0, 10e9]", pause)
        }
 }