Skip to content

Commit

Permalink
Merge pull request #3 from edyoung/time_unit_test
Browse files Browse the repository at this point in the history
make time unit test more reliable
  • Loading branch information
satmihir authored Nov 10, 2024
2 parents 5cbc700 + 42ee499 commit 50d8989
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/utils/time_utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ func TestClock(t *testing.T) {
t1 := time.Now()
t2 := clk.Now()

assert.True(t, t2.After(t1))
assert.True(t, t2.Compare(t1) >= 0)

clk.Sleep(10 * time.Millisecond)

assert.True(t, clk.Now().Sub(t2) > 10*time.Millisecond)
assert.True(t, clk.Now().Sub(t2) >= 10*time.Millisecond)
}

func TestTicket(t *testing.T) {
Expand Down

0 comments on commit 50d8989

Please sign in to comment.