grafana/pkg/util/retryer/retryer_test.go
kay delaney c4c5b2dc61
CloudWatch Logs queue and websocket support (#28176)
CloudWatch Logs queue and websocket support
2020-10-28 08:36:57 +00:00

23 lines
379 B
Go

package retryer
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestMaxRetries(t *testing.T) {
retryVal := 0
err := Retry(func() (RetrySignal, error) {
retryVal++
return FuncFailure, nil
}, 8, 100*time.Millisecond, 100*time.Millisecond)
if err != nil {
assert.FailNow(t, "Error while retrying function")
}
assert.Equal(t, 8, retryVal)
}