import "istio.io/istio/pkg/test/util/retry"
const ( // DefaultTimeout the default timeout for the entire retry operation DefaultTimeout = time.Second * 30 // DefaultDelay the default delay between successive retry attempts DefaultDelay = time.Millisecond * 10 // DefaultConverge the default converge, requiring something to succeed one time DefaultConverge = 1 )
func Do(fn RetriableFunc, options ...Option) (interface{}, error)
Do retries the given function, until there is a timeout, or until the function indicates that it has completed.
Until retries the given function until it returns true or hits the timeout timeout
UntilOrFail calls Until, and fails t with Fatalf if it ends up returning an error
UntilSuccess retries the given function until success, timeout, or until the passed-in function returns nil.
UntilSuccessOrFail calls UntilSuccess, and fails t with Fatalf if it ends up returning an error
type Option func(cfg *config)
Option for a retry operation.
Converge sets the number of successes in a row needed to count a success. This is useful to avoid the case where tests like `coin.Flip() == HEADS` will always return success due to random variance.
Delay sets the delay between successive retry attempts.
Message defines a more detailed error message to use when failing
Timeout sets the timeout for the entire retry operation.
RetriableFunc a function that can be retried.
Package retry imports 4 packages (graph) and is imported by 21 packages. Updated 2020-12-31. Refresh now. Tools for package owners.