Skip to content

Commit

Permalink
add a sanity check for capped delay in backoff tsts
Browse files Browse the repository at this point in the history
  • Loading branch information
danwt committed May 1, 2024
1 parent 80f44ca commit 7c6c0ec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions utils/retry/backoff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ func TestBackoff(t *testing.T) {
last = d
}
})
t.Run("maximum", func(t *testing.T) {
d := time.Second
b := NewBackoffConfig(WithInitialDelay(time.Second), WithMaxDelay(d)).Backoff()
for range 10 {
require.Equal(t, time.Second, b.Delay())
}
})
}

0 comments on commit 7c6c0ec

Please sign in to comment.