func MustNewGrpcClient(c *check.C, addr string) pdpb.PDClient {
	conn, err := grpc.Dial(strings.TrimPrefix(addr, "http://"), grpc.WithInsecure())
	c.Assert(err, check.IsNil)
	return pdpb.NewPDClient(conn)
}
MustNewGrpcClient must create a new grpc client.
package testutil
import (
	"os"
	"strings"
	"time"
	"github.com/pingcap/check"
	"github.com/pingcap/kvproto/pkg/pdpb"
	"google.golang.org/grpc"
)
const (
	waitMaxRetry   = 200
	waitRetrySleep = time.Millisecond * 100
)
type CheckFunc func(c *check.C) bool
type WaitOp struct {
	retryTimes    int
	sleepInterval time.Duration
}
type WaitOption func(op *WaitOp)
func WithRetryTimes(retryTimes int) WaitOption {
	return func(op *WaitOp) { op.retryTimes = retryTimes }
}
func WithSleepInterval(sleep time.Duration) WaitOption {
	return func(op *WaitOp) { op.sleepInterval = sleep }
}
func WaitUntil(c *check.C, f CheckFunc, opts ...WaitOption) {
	c.Log("wait start")
	option := &WaitOp{
		retryTimes:    waitMaxRetry,
		sleepInterval: waitRetrySleep,
	}
	for _, opt := range opts {
		opt(option)
	}
	for i := 0; i < option.retryTimes; i++ {
		if f(c) {
			return
		}
		time.Sleep(option.sleepInterval)
	}
	c.Fatal("wait timeout")
}
func NewRequestHeader(clusterID uint64) *pdpb.RequestHeader {
	return &pdpb.RequestHeader{
		ClusterId: clusterID,
	}
}