import "istio.io/istio/tests/util"
common_utils.go compare_utils.go retry.go
Backoff returns a random value in [0, maxDelay] that increases exponentially with retries, starting from baseDelay. It is the Go equivalent to C++'s //util/time/backoff.cc.
Compare compares two byte slices. It returns an error with a contextual diff if they are not equal.
RandomString returns a random string of size n (letters only)
Break the retry loop if the error returned is of this type.
type Retrier struct { // BaseDelay is the minimum delay between retry attempts. BaseDelay time.Duration // MaxDelay is the maximum delay allowed between retry attempts. MaxDelay time.Duration // MaxDuration is the maximum cumulative duration allowed for all retries MaxDuration time.Duration // Retries defines number of retry attempts Retries int }
Retrier contains the retry configuration parameters.
func (r Retrier) Retry(ctx context.Context, fn func(ctx context.Context, retryIndex int) error) (int, error)
Retry calls the given function a number of times, unless it returns a nil or a Break
Path | Synopsis |
---|---|
leak | leak checks for goroutine leaks in tests This is (heavily) inspired by https://github.com/grpc/grpc-go/blob/master/internal/leakcheck/leakcheck.go and https://github.com/fortytw2/leaktest |
sanitycheck |
Package util imports 7 packages (graph). Updated 2021-01-09. Refresh now. Tools for package owners.