wait

package
v0.12.1-beta-branch Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Invariant

func Invariant(statement func() bool, timeout time.Duration) error

Invariant is a helper test function that will wait for a timeout period of time, verifying that a statement remains true for the entire duration. This function is helpful as timing doesn't always line up well when running integration tests with several running lnd nodes. This function gives callers a way to assert that some property is maintained over a particular time frame.

func InvariantNoError

func InvariantNoError(f func() error, timeout time.Duration) error

InvariantNoError is a wrapper around Invariant that waits out the duration specified by timeout. It fails if the predicate ever returns an error during that time.

func NoError

func NoError(f func() error, timeout time.Duration) error

NoError is a wrapper around Predicate that waits for the passed method f to execute without error, and returns the last error encountered if this doesn't happen within the timeout.

func Predicate

func Predicate(pred func() bool, timeout time.Duration) error

Predicate is a helper test function that will wait for a timeout period of time until the passed predicate returns true. This function is helpful as timing doesn't always line up well when running integration tests with several running lnd nodes. This function gives callers a way to assert that some property is upheld within a particular time frame.

Types

This section is empty.

Jump to

Keyboard shortcuts

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