poller

package
v0.0.0-...-97ebcb8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: Apache-2.0, BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitFor

func WaitFor[T any](t *testing.T, timeout time.Duration, poll func() (T, error), check func(T) bool) T

WaitFor continuously calls poll until check returns true. It then polls for a little longer to make sure that poll still returns a value v such that check(v) is true. If the condition never happens, or the condition becomes true and then false, it invokes t.Fatal.

If poll returns an error, WaitFor calls Fatal.

WaitFor returns the last value that poll returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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