test

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const CONSISTENTLY_ACCEPTANCE_TIMEOUT = 20 * time.Millisecond
View Source
const CONSISTENTLY_ADAPTER_TIMEOUT = 50 * time.Millisecond
View Source
const CONSISTENTLY_DOCKER_E2E_TIMEOUT = 500 * time.Millisecond
View Source
const CONSISTENTLY_LOCAL_E2E_TIMEOUT = 200 * time.Millisecond
View Source
const EVENTUALLY_ACCEPTANCE_TIMEOUT = 40 * time.Millisecond
View Source
const EVENTUALLY_ADAPTER_TIMEOUT = 100 * time.Millisecond
View Source
const EVENTUALLY_DOCKER_E2E_TIMEOUT = 1000 * time.Millisecond
View Source
const EVENTUALLY_LOCAL_E2E_TIMEOUT = 400 * time.Millisecond

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 AssertCmpEqual

func AssertCmpEqual(t *testing.T, expected interface{}, actual interface{}, msgAndArgs ...interface{}) bool

func Consistently

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

func ConsistentlyVerify

func ConsistentlyVerify(timeout time.Duration, mocks ...mock.HasVerify) error

func CreateTempDirForTest

func CreateTempDirForTest(t *testing.T) string

func DebugPrintGoroutineStacks

func DebugPrintGoroutineStacks()

func Eventually

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

func EventuallyVerify

func EventuallyVerify(timeout time.Duration, mocks ...mock.HasVerify) error

func RandomPort

func RandomPort() int

func RequireCmpEqual

func RequireCmpEqual(t *testing.T, expected interface{}, actual interface{}, msgAndArgs ...interface{})

func RequireDoesNotContainNil added in v0.7.1

func RequireDoesNotContainNil(t *testing.T, obj interface{}) bool

func RequireNoUnexpectedErrors

func RequireNoUnexpectedErrors(f Fataler, errorTracker ErrorTracker)

func RequireStatus

func RequireStatus(t *testing.T, status protocol.TransactionStatus, tx transactionStatuser, msg string)

func RequireSuccess

func RequireSuccess(t *testing.T, tx transactionStatuser, msg string, args ...interface{})

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(d time.Duration, f func(ctx context.Context))

Types

type ControlledRand added in v0.7.1

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

tests should use this random object when generating random values

func NewControlledRand added in v0.7.1

func NewControlledRand(t testLogger) *ControlledRand

func (ControlledRand) Float32 added in v0.7.1

func (sr ControlledRand) Float32() float32

func (ControlledRand) Float64 added in v0.7.1

func (sr ControlledRand) Float64() float64

func (ControlledRand) Int added in v0.7.1

func (sr ControlledRand) Int() int

func (ControlledRand) Int31 added in v0.7.1

func (sr ControlledRand) Int31() int32

func (ControlledRand) Int31n added in v0.7.1

func (sr ControlledRand) Int31n(n int32) int32

func (ControlledRand) Int63 added in v0.7.1

func (sr ControlledRand) Int63() int64

func (ControlledRand) Int63n added in v0.7.1

func (sr ControlledRand) Int63n(n int64) int64

func (ControlledRand) Intn added in v0.7.1

func (sr ControlledRand) Intn(n int) int

func (ControlledRand) Perm added in v0.7.1

func (sr ControlledRand) Perm(n int) []int

func (ControlledRand) Read added in v0.7.1

func (sr ControlledRand) Read(p []byte) (n int, err error)

func (ControlledRand) Seed added in v0.7.1

func (sr ControlledRand) Seed(seed int64)

func (ControlledRand) Shuffle added in v0.7.1

func (sr ControlledRand) Shuffle(n int, swap func(i, j int))

func (ControlledRand) Uint32 added in v0.7.1

func (sr ControlledRand) Uint32() uint32

func (ControlledRand) Uint64 added in v0.7.1

func (sr ControlledRand) Uint64() uint64

type ErrorTracker

type ErrorTracker interface {
	HasErrors() bool
	GetUnexpectedErrors() []string
}

type Fataler

type Fataler interface {
	Fatal(args ...interface{})
}

Directories

Path Synopsis
crypto
e2e
Package external contains tests that rely on external resources being pre-deployed, for instance an Ethereum node or Ganache
Package external contains tests that rely on external resources being pre-deployed, for instance an Ethereum node or Ganache
services/gossip/adapter
Package adapter extends the in-process transport adapter with Tampering capabilities, intended to be used by system-wide acceptance tests
Package adapter extends the in-process transport adapter with Tampering capabilities, intended to be used by system-wide acceptance tests

Jump to

Keyboard shortcuts

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