all: use AbsTime.Add instead of conversion (#25417)

This commit is contained in:
Seungbae Yu
2022-07-29 18:23:30 +02:00
committed by GitHub
parent 9ad508018e
commit 029059947a
6 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ func TestUpdateTimer(t *testing.T) {
if updated := timer.Update(func(diff time.Duration) bool { return true }); !updated {
t.Fatalf("Doesn't update the clock when reaching the threshold")
}
if updated := timer.UpdateAt(sim.Now()+mclock.AbsTime(time.Second), func(diff time.Duration) bool { return true }); !updated {
if updated := timer.UpdateAt(sim.Now().Add(time.Second), func(diff time.Duration) bool { return true }); !updated {
t.Fatalf("Doesn't update the clock when reaching the threshold")
}
timer = NewUpdateTimer(sim, 0)