Skip to content

Commit c818d96

Browse files
committed
Unflake TestGoCollectorGC
It is perfectly possible that a normal GC happens just before the forced one. Thus seeing 2 GCs is fine. Whenever this test failed, it was because two GCs were seen. Signed-off-by: beorn7 <[email protected]>
1 parent b46e6ec commit c818d96

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

prometheus/go_collector_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,11 @@ func TestGoCollectorGC(t *testing.T) {
138138
close(waitCh)
139139
continue
140140
}
141-
if diff := *pb.GetSummary().SampleCount - oldGC; diff != 1 {
142-
t.Errorf("want 1 new garbage collection run, got %d", diff)
141+
if diff := *pb.GetSummary().SampleCount - oldGC; diff < 1 {
142+
t.Errorf("want at least 1 new garbage collection run, got %d", diff)
143143
}
144144
if diff := *pb.GetSummary().SampleSum - oldPause; diff <= 0 {
145-
t.Errorf("want moar pause, got %f", diff)
145+
t.Errorf("want an increase in pause time, got a change of %f", diff)
146146
}
147147
case <-time.After(1 * time.Second):
148148
t.Fatalf("expected collect timed out")

0 commit comments

Comments
 (0)