etcd: go.etcd.io/etcd/integration Index | Files

package integration

import "go.etcd.io/etcd/integration"

Package integration implements tests built upon embedded etcd, and focus on etcd correctness.

Features/goals of the integration tests: 1. test the whole code base except command-line parsing. 2. check internal data, including raft, store and etc. 3. based on goroutines, which is faster than process. 4. mainly tests user behavior and user-facing API.

Index

Package Files

bridge.go cluster.go cluster_direct.go doc.go

Constants

const (
    // RequestWaitTimeout is the time duration to wait for a request to go through or detect leader loss.
    RequestWaitTimeout = 3 * time.Second

    URLScheme    = "unix"
    URLSchemeTLS = "unixs"
)

func MustNewHTTPClient Uses

func MustNewHTTPClient(t testing.TB, eps []string, tls *transport.TLSInfo) client.Client

func NewClientV3 Uses

func NewClientV3(m *member) (*clientv3.Client, error)

NewClientV3 creates a new grpc client connection to the member

func NewCluster Uses

func NewCluster(t testing.TB, size int) *cluster

NewCluster returns an unlaunched cluster of the given size which has been set to use static bootstrap.

func NewClusterByConfig Uses

func NewClusterByConfig(t testing.TB, cfg *ClusterConfig) *cluster

NewClusterByConfig returns an unlaunched cluster defined by a cluster configuration

func NewListenerWithAddr Uses

func NewListenerWithAddr(t testing.TB, addr string) net.Listener

func WaitClientV3 Uses

func WaitClientV3(t testing.TB, kv clientv3.KV)

type ClusterConfig Uses

type ClusterConfig struct {
    Size      int
    PeerTLS   *transport.TLSInfo
    ClientTLS *transport.TLSInfo

    DiscoveryURL string

    AuthToken string

    UseGRPC bool

    QuotaBackendBytes int64

    MaxTxnOps              uint
    MaxRequestBytes        uint
    SnapshotCount          uint64
    SnapshotCatchUpEntries uint64

    GRPCKeepAliveMinTime  time.Duration
    GRPCKeepAliveInterval time.Duration
    GRPCKeepAliveTimeout  time.Duration

    // SkipCreatingClient to skip creating clients for each member.
    SkipCreatingClient bool

    ClientMaxCallSendMsgSize int
    ClientMaxCallRecvMsgSize int

    // UseIP is true to use only IP for gRPC requests.
    UseIP bool

    EnableLeaseCheckpoint   bool
    LeaseCheckpointInterval time.Duration
}

type ClusterV3 Uses

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

func NewClusterV3 Uses

func NewClusterV3(t testing.TB, cfg *ClusterConfig) *ClusterV3

NewClusterV3 returns a launched cluster with a grpc client connection for each cluster member.

func (*ClusterV3) AddAndLaunchLearnerMember Uses

func (c *ClusterV3) AddAndLaunchLearnerMember(t testing.TB)

AddAndLaunchLearnerMember creates a leaner member, adds it to cluster via v3 MemberAdd API, and then launches the new member.

func (ClusterV3) AddMember Uses

func (c ClusterV3) AddMember(t testing.TB)

func (*ClusterV3) Client Uses

func (c *ClusterV3) Client(i int) *clientv3.Client

func (*ClusterV3) GetLearnerMembers Uses

func (c *ClusterV3) GetLearnerMembers() ([]*pb.Member, error)

GetLearnerMembers returns the list of learner members in cluster using MemberList API.

func (ClusterV3) HTTPMembers Uses

func (c ClusterV3) HTTPMembers() []client.Member

HTTPMembers returns a list of all active members as client.Members

func (ClusterV3) Launch Uses

func (c ClusterV3) Launch(t testing.TB)

func (*ClusterV3) MustNewMember Uses

func (c *ClusterV3) MustNewMember(t testing.TB, resp *clientv3.MemberAddResponse) *member

MustNewMember creates a new member instance based on the response of V3 Member Add API.

func (*ClusterV3) RandClient Uses

func (c *ClusterV3) RandClient() *clientv3.Client

func (ClusterV3) RemoveMember Uses

func (c ClusterV3) RemoveMember(t testing.TB, id uint64)

func (*ClusterV3) TakeClient Uses

func (c *ClusterV3) TakeClient(idx int)

func (*ClusterV3) Terminate Uses

func (c *ClusterV3) Terminate(t testing.TB)

func (ClusterV3) URL Uses

func (c ClusterV3) URL(i int) string

func (ClusterV3) URLs Uses

func (c ClusterV3) URLs() []string

URLs returns a list of all active client URLs in the cluster

func (ClusterV3) WaitLeader Uses

func (c ClusterV3) WaitLeader(t testing.TB) int

func (ClusterV3) WaitNoLeader Uses

func (c ClusterV3) WaitNoLeader()

type SortableMemberSliceByPeerURLs Uses

type SortableMemberSliceByPeerURLs []client.Member

func (SortableMemberSliceByPeerURLs) Len Uses

func (p SortableMemberSliceByPeerURLs) Len() int

func (SortableMemberSliceByPeerURLs) Less Uses

func (p SortableMemberSliceByPeerURLs) Less(i, j int) bool

func (SortableMemberSliceByPeerURLs) Swap Uses

func (p SortableMemberSliceByPeerURLs) Swap(i, j int)

type SortableProtoMemberSliceByPeerURLs Uses

type SortableProtoMemberSliceByPeerURLs []*pb.Member

func (SortableProtoMemberSliceByPeerURLs) Len Uses

func (p SortableProtoMemberSliceByPeerURLs) Len() int

func (SortableProtoMemberSliceByPeerURLs) Less Uses

func (p SortableProtoMemberSliceByPeerURLs) Less(i, j int) bool

func (SortableProtoMemberSliceByPeerURLs) Swap Uses

func (p SortableProtoMemberSliceByPeerURLs) Swap(i, j int)

Package integration imports 43 packages (graph). Updated 2019-06-14. Refresh now. Tools for package owners.