mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-20 06:31:32 +03:00
54a0155ed6
* wip: deal with lots of connections * Clean up TestDatabase_SourceMetadata_concurrent * Fixed error message
18 lines
330 B
Go
18 lines
330 B
Go
package retry_test
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
|
|
"github.com/neilotoole/sq/libsq/core/retry"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
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)
|
|
}
|
|
}
|