mirror of
https://github.com/redis/go-redis.git
synced 2025-07-28 06:42:00 +03:00
Added backoff retry
This commit is contained in:
committed by
Vladimir Mihailenco
parent
368f0ea0ba
commit
406e882c43
17
internal/internal_test.go
Normal file
17
internal/internal_test.go
Normal file
@ -0,0 +1,17 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"testing"
|
||||
. "github.com/onsi/gomega"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestRetryBackoff(t *testing.T) {
|
||||
RegisterTestingT(t)
|
||||
|
||||
for i := -1; i<= 8; i++ {
|
||||
backoff := RetryBackoff(i, 512*time.Millisecond)
|
||||
Expect(backoff >= 0).To(BeTrue())
|
||||
Expect(backoff <= 512*time.Millisecond).To(BeTrue())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user