1
0
mirror of https://github.com/golang/go synced 2024-10-01 16:28:33 -06:00

runtime: fix TestGcLastTime on windows

Intended to fix:
http://build.golang.org/log/d6718ea67541b8c6be2bb14bcbc4e1c4261f67d7

LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews
https://golang.org/cl/127520043
This commit is contained in:
Dmitriy Vyukov 2014-08-19 19:32:27 +04:00
parent c6442c994a
commit 8c25e08fbd

View 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)
}
}