testhelp

package
v3.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2021 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlwaysFails

func AlwaysFails(_ context.Context) error

AlwaysFails is a runFunc that always fails

func AlwaysFailsFallback

func AlwaysFailsFallback(_ context.Context, err error) error

AlwaysFailsFallback is a fallback circuit that always fails

func AlwaysPasses

func AlwaysPasses(_ context.Context) error

AlwaysPasses is a runFunc that always passes

func AlwaysPassesFallback

func AlwaysPassesFallback(_ context.Context, _ error) error

AlwaysPassesFallback is a fallback circuit that always passes

func DoTillTime

func DoTillTime(endTime time.Time, wg *sync.WaitGroup, f func())

DoTillTime concurrently calls f() in a forever loop until endTime

func MustNotTesting

func MustNotTesting(t *testing.T, err error)

MustNotTesting errors if err == nil

func MustTesting

func MustTesting(t *testing.T, err error)

MustTesting errors if err != nil

func SleepsForX

func SleepsForX(d time.Duration) func(context.Context) error

SleepsForX waits for a duration, or until the passed in context fails

Types

type BehaviorCheck

type BehaviorCheck struct {
	TotalRuns int64

	LongestRunDuration time.Duration
	MostConcurrent     int64

	RunFunc func(ctx context.Context) error
	// contains filtered or unexported fields
}

BehaviorCheck tracks Run commands to help you test their logic

func (*BehaviorCheck) Run

func (b *BehaviorCheck) Run(ctx context.Context) (err error)

Run is a runFunc. Use this as the runFunc for your circuit

Jump to

Keyboard shortcuts

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