MCPcopy Create free account
hub / github.com/imroc/req / TestRetryInterval

Function TestRetryInterval

retry_test.go:37–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestRetryInterval(t *testing.T) {
38 testRetry(t, func(r *Request) {
39 r.SetRetryInterval(func(resp *Response, attempt int) time.Duration {
40 sleep := 0.01 * math.Exp2(float64(attempt))
41 return time.Duration(math.Min(2, sleep)) * time.Second
42 })
43 })
44}
45
46func TestRetryFixedInterval(t *testing.T) {
47 testRetry(t, func(r *Request) {

Callers

nothing calls this directly

Calls 2

testRetryFunction · 0.85
SetRetryIntervalMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…