diff options
| author | Brad Fitzpatrick <bradfitz@golang.org> | 2014-09-03 09:54:53 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2014-09-03 09:54:53 -0700 |
| commit | 4930a8d0582d96d390339d2ca454ff8375bb535a (patch) | |
| tree | 89a4023e71917afc06d7e92f6d4e047a5e005345 /src/pkg/runtime | |
| parent | 176c44699b5be7861070c01856494b6b94ff918a (diff) | |
| download | go-4930a8d0582d96d390339d2ca454ff8375bb535a.tar.xz | |
runtime: relax flaky GC pause test
We often saw GC pauses of 0 ns, not just on Windows.
Google Compute Engine timer granularity might suck
too.
LGTM=rsc
R=rsc, dvyukov
CC=golang-codereviews
https://golang.org/cl/140910043
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/gc_test.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pkg/runtime/gc_test.go b/src/pkg/runtime/gc_test.go index 816fc89b04..6abec4cca7 100644 --- a/src/pkg/runtime/gc_test.go +++ b/src/pkg/runtime/gc_test.go @@ -165,9 +165,12 @@ 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] - // 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) + // Due to timer granularity, pause can actually be 0 on windows + // or on virtualized environments. + if pause == 0 { + t.Logf("last GC pause was 0") + } else if pause > 10e9 { + t.Logf("bad last GC pause: got %v, want [0, 10e9]", pause) } } |
