test

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MIN_REST_DURATION  = 1 * time.Millisecond
	MAX_REST_DURATION  = 5 * time.Millisecond
	MIN_BURST_DURATION = 1 * time.Millisecond
	MAX_BURST_DURATION = 10 * time.Millisecond
)

Functions

func Consistently

func Consistently(timeout time.Duration, f func() bool) bool

func Eventually

func Eventually(timeout time.Duration, f func() bool) bool

func FailIfNotDoneByTimeout added in v0.2.0

func FailIfNotDoneByTimeout(t *testing.T, waitGroup *sync.WaitGroup, timeout time.Duration, format string, args ...interface{})

func NameHashPrefix added in v0.2.0

func NameHashPrefix(tb testing.TB, idLen int) string

func StartCpuSchedulingJitter

func StartCpuSchedulingJitter()

creates ongoing random bursts of cpu noise (all cores together) to make goroutine scheduling erratic in -count 100 flakiness tests

func WithContext

func WithContext(f func(ctx context.Context))

func WithContextWithTimeout

func WithContextWithTimeout(t *testing.T, d time.Duration, f func(ctx context.Context))

Types

type Latch

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

func NewLatch

func NewLatch(logger interfaces.Logger) *Latch

func (*Latch) Resume

func (l *Latch) Resume(ctx context.Context, memberId primitives.MemberId)

func (*Latch) ReturnWhenLatchIsPaused

func (l *Latch) ReturnWhenLatchIsPaused(ctx context.Context, memberId primitives.MemberId)

func (*Latch) WaitOnPauseThenWaitOnResume added in v0.2.0

func (l *Latch) WaitOnPauseThenWaitOnResume(ctx context.Context, memberId primitives.MemberId)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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