testutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAddPeer

func CheckAddPeer(t *testing.T, op *operator.Operator, kind operator.OpKind, containerID uint64)

CheckAddPeer checks if the operator is to add peer on specified container.

func CheckRemovePeer

func CheckRemovePeer(t *testing.T, op *operator.Operator, containerID uint64)

CheckRemovePeer checks if the operator is to remove peer on specified container.

func CheckTransferLeader

func CheckTransferLeader(t *testing.T, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64)

CheckTransferLeader checks if the operator is to transfer leader between the specified source and target containers.

func CheckTransferLeaderFrom

func CheckTransferLeaderFrom(t *testing.T, op *operator.Operator, kind operator.OpKind, sourceID uint64)

CheckTransferLeaderFrom checks if the operator is to transfer leader out of the specified container.

func CheckTransferLearner

func CheckTransferLearner(t *testing.T, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64)

CheckTransferLearner checks if the operator is to transfer learner between the specified source and target containers.

func CheckTransferPeer

func CheckTransferPeer(t *testing.T, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64)

CheckTransferPeer checks if the operator is to transfer peer between the specified source and target containers.

func CheckTransferPeerWithLeaderTransfer

func CheckTransferPeerWithLeaderTransfer(t *testing.T, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64)

CheckTransferPeerWithLeaderTransfer checks if the operator is to transfer peer between the specified source and target containers and it meanwhile transfers the leader out of source container.

func CheckTransferPeerWithLeaderTransferFrom

func CheckTransferPeerWithLeaderTransferFrom(t *testing.T, op *operator.Operator, kind operator.OpKind, sourceID uint64)

CheckTransferPeerWithLeaderTransferFrom checks if the operator is to transfer peer out of the specified container and it meanwhile transfers the leader out of the container.

func WaitUntil

func WaitUntil(t *testing.T, f CheckFunc, opts ...WaitOption)

WaitUntil repeatedly evaluates f() for a period of time, util it returns true.

Types

type CheckFunc

type CheckFunc func(t *testing.T) bool

CheckFunc is a condition checker that passed to WaitUntil. Its implementation may call c.Fatal() to abort the test, or c.Log() to add more information.

type WaitOp

type WaitOp struct {
	SleepInterval time.Duration
}

WaitOp represents available options when execute WaitUntil

type WaitOption

type WaitOption func(op *WaitOp)

WaitOption configures WaitOp

func WithSleepInterval

func WithSleepInterval(sleep time.Duration) WaitOption

WithSleepInterval specify the sleep duration

Jump to

Keyboard shortcuts

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