sq/libsq/core/retry/retry_test.go
2023-11-19 18:06:36 -07:00

19 lines
331 B
Go

package retry_test
import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/neilotoole/sq/libsq/core/retry"
)
func TestJitter(t *testing.T) {
for i := 0; i < 1000; i++ {
got := retry.Jitter()
require.LessOrEqual(t, got, time.Millisecond*25)
require.GreaterOrEqual(t, got, time.Millisecond*5)
}
}