Versions in this module Expand all Collapse all v0 v0.1.0 Jun 15, 2023 Changes in this version + const Destroy + const Initial + const Running + const Stop + var WaitLeaderCheckInterval = 500 * time.Millisecond + var WaitLeaderReturnDelay = 20 * time.Millisecond + type ConfigOption func(conf *config.Config, serverName string) + type TestCluster struct + func NewTestAPICluster(ctx context.Context, initialServerCount int, opts ...ConfigOption) (*TestCluster, error) + func NewTestCluster(ctx context.Context, initialServerCount int, opts ...ConfigOption) (*TestCluster, error) + func (c *TestCluster) CheckClusterDCLocation() + func (c *TestCluster) CheckTSOUnique(ts uint64) bool + func (c *TestCluster) Destroy() + func (c *TestCluster) GetCluster() *metapb.Cluster + func (c *TestCluster) GetClusterStatus() (*cluster.Status, error) + func (c *TestCluster) GetConfig() *clusterConfig + func (c *TestCluster) GetEtcdClient() *clientv3.Client + func (c *TestCluster) GetFollower() string + func (c *TestCluster) GetHTTPClient() *http.Client + func (c *TestCluster) GetLeader() string + func (c *TestCluster) GetServer(name string) *TestServer + func (c *TestCluster) GetServers() map[string]*TestServer + func (c *TestCluster) HandleRegionHeartbeat(region *core.RegionInfo) error + func (c *TestCluster) Join(ctx context.Context, opts ...ConfigOption) (*TestServer, error) + func (c *TestCluster) JoinAPIServer(ctx context.Context, opts ...ConfigOption) (*TestServer, error) + func (c *TestCluster) ResignLeader() error + func (c *TestCluster) RunInitialServers() error + func (c *TestCluster) RunServer(server *TestServer) <-chan error + func (c *TestCluster) RunServers(servers []*TestServer) error + func (c *TestCluster) StopAll() error + func (c *TestCluster) WaitAllLeaders(re *require.Assertions, dcLocations map[string]string) + func (c *TestCluster) WaitAllocatorLeader(dcLocation string, ops ...WaitOption) string + func (c *TestCluster) WaitLeader(ops ...WaitOption) string + func (c *TestCluster) WaitRegionSyncerClientsReady(n int) bool + type TestServer struct + func NewTestAPIServer(ctx context.Context, cfg *config.Config) (*TestServer, error) + func NewTestServer(ctx context.Context, cfg *config.Config) (*TestServer, error) + func (s *TestServer) BootstrapCluster() error + func (s *TestServer) Destroy() error + func (s *TestServer) GetAddr() string + func (s *TestServer) GetAdjacentRegions(region *core.RegionInfo) []*core.RegionInfo + func (s *TestServer) GetAllocator() id.Allocator + func (s *TestServer) GetAllocatorLeader(dcLocation string) *pdpb.Member + func (s *TestServer) GetCluster() *metapb.Cluster + func (s *TestServer) GetClusterID() uint64 + func (s *TestServer) GetClusterVersion() semver.Version + func (s *TestServer) GetConfig() *config.Config + func (s *TestServer) GetEtcdClient() *clientv3.Client + func (s *TestServer) GetEtcdLeader() (string, error) + func (s *TestServer) GetEtcdLeaderID() (uint64, error) + func (s *TestServer) GetHTTPClient() *http.Client + func (s *TestServer) GetKeyspaceManager() *keyspace.Manager + func (s *TestServer) GetLeader() *pdpb.Member + func (s *TestServer) GetPersistOptions() *config.PersistOptions + func (s *TestServer) GetRaftCluster() *cluster.RaftCluster + func (s *TestServer) GetRangeHoles() [][]string + func (s *TestServer) GetRegionInfoByID(regionID uint64) *core.RegionInfo + func (s *TestServer) GetRegions() []*core.RegionInfo + func (s *TestServer) GetServer() *server.Server + func (s *TestServer) GetServerID() uint64 + func (s *TestServer) GetStore(storeID uint64) *core.StoreInfo + func (s *TestServer) GetStoreRegions(storeID uint64) []*core.RegionInfo + func (s *TestServer) GetStores() []*metapb.Store + func (s *TestServer) GetTSOAllocatorManager() *tso.AllocatorManager + func (s *TestServer) IsAllocatorLeader(dcLocation string) bool + func (s *TestServer) IsLeader() bool + func (s *TestServer) MoveEtcdLeader(old, new uint64) error + func (s *TestServer) ResignLeader() error + func (s *TestServer) Run() error + func (s *TestServer) SetEnableLocalTSO(enableLocalTSO bool) + func (s *TestServer) State() int32 + func (s *TestServer) Stop() error + func (s *TestServer) WaitLeader() bool + type WaitOp struct + type WaitOption func(*WaitOp) + func WithRetryTimes(r int) WaitOption + func WithWaitInterval(i time.Duration) WaitOption