Skip to content

Commit 8c25e08

Browse files
committed
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
1 parent c6442c9 commit 8c25e08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pkg/runtime/gc_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ func TestGcLastTime(t *testing.T) {
165165
t.Fatalf("bad last GC time: got %v, want [%v, %v]", last, t0, t1)
166166
}
167167
pause := ms.PauseNs[(ms.NumGC+255)%256]
168-
if pause == 0 || pause > 10e9 {
168+
// Due to timer granularity pause can actually be 0 on windows.
169+
if (pause == 0 && runtime.GOOS != "windows") || pause > 10e9 {
169170
t.Fatalf("bad last GC pause: got %v, want [0, 10e9]", pause)
170171
}
171172
}

0 commit comments

Comments
 (0)