Skip to content

Commit

Permalink
Remove inherently flaky test
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <rohit@planetscale.com>
  • Loading branch information
rohit-nayak-ps committed Jan 10, 2025
1 parent 555f1d7 commit 003ccd9
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions go/timer/randticker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,3 @@ func TestTick(t *testing.T) {
t.Error("Channel was not closed")
}
}

func TestTickSkip(t *testing.T) {
tkr := NewRandTicker(10*time.Millisecond, 1*time.Millisecond)
time.Sleep(35 * time.Millisecond)
end := <-tkr.C
diff := time.Since(end)
if diff < 20*time.Millisecond {
t.Errorf("diff: %v, want >20ms", diff)
}

// This tick should be up-to-date
end = <-tkr.C
diff = time.Since(end)
if diff > 1*time.Millisecond {
t.Errorf("diff: %v, want <1ms", diff)
}
tkr.Stop()
}

0 comments on commit 003ccd9

Please sign in to comment.