MCPcopy Create free account
hub / github.com/cenkalti/backoff / TestBackOffRandomizedOverflow

Function TestBackOffRandomizedOverflow

exponential_test.go:71–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestBackOffRandomizedOverflow(t *testing.T) {
72 exp := NewExponentialBackOff()
73 exp.InitialInterval = math.MaxInt64
74 exp.MaxInterval = math.MaxInt64
75 exp.RandomizationFactor = 0.5
76 exp.Reset()
77
78 for range 100 {
79 if next := exp.NextBackOff(); next < 0 {
80 t.Fatalf("NextBackOff() = %d, want non-negative", next)
81 }
82 }
83}
84
85func assertEquals(t *testing.T, expected, value time.Duration) {
86 if expected != value {

Callers

nothing calls this directly

Calls 3

ResetMethod · 0.95
NextBackOffMethod · 0.95
NewExponentialBackOffFunction · 0.85

Tested by

no test coverage detected