Back to godoc.org

Package testutil

v3.1.2
Latest Go to latest

The latest major version is v4.

Published: Apr 26, 2020 | License: Apache-2.0 | Module: github.com/pingcap/pd/v3

Index

Variables

var LeakOptions = []goleak.Option{
	goleak.IgnoreTopFunction("github.com/syndtr/goleveldb/leveldb.(*DB).mpoolDrain"),
	goleak.IgnoreTopFunction("github.com/syndtr/goleveldb/leveldb.(*DB).tCompaction"),
	goleak.IgnoreTopFunction("github.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain"),
	goleak.IgnoreTopFunction("github.com/syndtr/goleveldb/leveldb.(*DB).mCompaction"),
	goleak.IgnoreTopFunction("github.com/syndtr/goleveldb/leveldb.(*DB).compactionError"),
	goleak.IgnoreTopFunction("google.golang.org/grpc.(*ccBalancerWrapper).watcher"),
	goleak.IgnoreTopFunction("google.golang.org/grpc.(*ccResolverWrapper).watcher"),
	goleak.IgnoreTopFunction("google.golang.org/grpc.(*addrConn).createTransport"),
	goleak.IgnoreTopFunction("google.golang.org/grpc.(*addrConn).resetTransport"),
	goleak.IgnoreTopFunction("go.etcd.io/etcd/pkg/logutil.(*MergeLogger).outputLoop"),

	goleak.IgnoreTopFunction("internal/poll.runtime_pollWait"),
	goleak.IgnoreTopFunction("net/http.(*persistConn).writeLoop"),
	goleak.IgnoreTopFunction("net/http.(*persistConn).readLoop"),
	goleak.IgnoreTopFunction("runtime.goparkunlock"),
}

LeakOptions is used to filter the goroutines.

func CheckAddPeer

func CheckAddPeer(c *check.C, op *operator.Operator, kind operator.OpKind, storeID uint64)

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

func CheckRemovePeer

func CheckRemovePeer(c *check.C, op *operator.Operator, storeID uint64)

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

func CheckTransferLeader

func CheckTransferLeader(c *check.C, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64)

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

func CheckTransferLeaderFrom

func CheckTransferLeaderFrom(c *check.C, op *operator.Operator, kind operator.OpKind, sourceID uint64)

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

func CheckTransferLearner

func CheckTransferLearner(c *check.C, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64)

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

func CheckTransferPeer

func CheckTransferPeer(c *check.C, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64)

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

func CheckTransferPeerWithLeaderTransfer

func CheckTransferPeerWithLeaderTransfer(c *check.C, op *operator.Operator, kind operator.OpKind, sourceID, targetID uint64)

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

func CheckTransferPeerWithLeaderTransferFrom

func CheckTransferPeerWithLeaderTransferFrom(c *check.C, op *operator.Operator, kind operator.OpKind, sourceID uint64)

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

func CleanServer

func CleanServer(dataDir string)

CleanServer is used to clean data directory.

func MustNewGrpcClient

func MustNewGrpcClient(c *check.C, addr string) pdpb.PDClient

MustNewGrpcClient must create a new grpc client.

func NewRequestHeader

func NewRequestHeader(clusterID uint64) *pdpb.RequestHeader

NewRequestHeader creates a new request header.

func WaitUntil

func WaitUntil(c *check.C, f CheckFunc)

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

type CheckFunc

type CheckFunc func(c *check.C) 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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier