retry

package
v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package retry provides a way to determine when a task should be retried.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNeeded

func IsNeeded(result *steps.ExecuteResponse_TaskResult) bool

IsNeeded determines if a task result indicates that the invocation needs to be retried.

Panics on unknown verdicts.

Types

type Counter

type Counter struct {
	// contains filtered or unexported fields
}

Counter tracks retries across tests and exposes a method to decide if a particular test can be retried any further.

func NewCounter

NewCounter initializes a new Counter.

func (*Counter) CanRetry

func (c *Counter) CanRetry(ctx context.Context, iid types.InvocationID) bool

CanRetry determines if a retry is allowed for a test based on the count of retries so far.

CanRetry panics for an unknown types.InvocationID.

func (*Counter) NotifyRetry

func (c *Counter) NotifyRetry(iid types.InvocationID)

NotifyRetry notifies retryCounter of a retry attempt for a test.

NotifyRetry panics for an unknown types.InvocationID.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL