retry

package
v1.0.60 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(t *testing.T, maxAttempts int, sleep time.Duration, f func(r *R)) bool

Types

type R

type R struct {
	// The number of current attempt.
	Attempt int
	// contains filtered or unexported fields
}

R is passed to each run of a flaky test run, manages state and accumulates log statements.

func (*R) Errorf

func (r *R) Errorf(s string, v ...interface{})

Errorf is equivalent to Logf followed by Fail.

func (*R) Fail

func (r *R) Fail()

Fail marks the run as failed, and will retry once the function returns.

func (*R) Logf

func (r *R) Logf(s string, v ...interface{})

Logf formats its arguments and records it in the error log. The text is only printed for the final unsuccessful run or the first successful run.

Jump to

Keyboard shortcuts

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