Skip to content

Commit

Permalink
tests: add client failover on defrag test case in e2e
Browse files Browse the repository at this point in the history
Signed-off-by: Chao Chen <[email protected]>
  • Loading branch information
chaochn47 committed Oct 25, 2023
1 parent ea03547 commit 913c825
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 26 deletions.
6 changes: 6 additions & 0 deletions tests/framework/e2e/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,12 @@ func WithExperimentalWarningUnaryRequestDuration(time time.Duration) EPClusterOp
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.ExperimentalWarningUnaryRequestDuration = time }
}

func WithExperimentalStopGRPCServiceOnDefrag(stopGRPCServiceOnDefrag bool) EPClusterOption {
return func(c *EtcdProcessClusterConfig) {
c.ServerConfig.ExperimentalStopGRPCServiceOnDefrag = stopGRPCServiceOnDefrag
}
}

func WithCompactionBatchLimit(limit int) EPClusterOption {
return func(c *EtcdProcessClusterConfig) { c.ServerConfig.ExperimentalCompactionBatchLimit = limit }
}
Expand Down
58 changes: 32 additions & 26 deletions tests/framework/integration/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ type ClusterConfig struct {
ExperimentalMaxLearners int
DisableStrictReconfigCheck bool
CorruptCheckTime time.Duration

ExperimentalStopGRPCServiceOnDefrag bool
}

type Cluster struct {
Expand Down Expand Up @@ -262,32 +264,33 @@ func (c *Cluster) mustNewMember(t testutil.TB) *Member {

m := MustNewMember(t,
MemberConfig{
Name: fmt.Sprintf("m%v", memberNumber),
MemberNumber: memberNumber,
AuthToken: c.Cfg.AuthToken,
AuthTokenTTL: c.Cfg.AuthTokenTTL,
PeerTLS: c.Cfg.PeerTLS,
ClientTLS: c.Cfg.ClientTLS,
QuotaBackendBytes: c.Cfg.QuotaBackendBytes,
MaxTxnOps: c.Cfg.MaxTxnOps,
MaxRequestBytes: c.Cfg.MaxRequestBytes,
SnapshotCount: c.Cfg.SnapshotCount,
SnapshotCatchUpEntries: c.Cfg.SnapshotCatchUpEntries,
GrpcKeepAliveMinTime: c.Cfg.GRPCKeepAliveMinTime,
GrpcKeepAliveInterval: c.Cfg.GRPCKeepAliveInterval,
GrpcKeepAliveTimeout: c.Cfg.GRPCKeepAliveTimeout,
ClientMaxCallSendMsgSize: c.Cfg.ClientMaxCallSendMsgSize,
ClientMaxCallRecvMsgSize: c.Cfg.ClientMaxCallRecvMsgSize,
UseIP: c.Cfg.UseIP,
UseBridge: c.Cfg.UseBridge,
UseTCP: c.Cfg.UseTCP,
EnableLeaseCheckpoint: c.Cfg.EnableLeaseCheckpoint,
LeaseCheckpointInterval: c.Cfg.LeaseCheckpointInterval,
LeaseCheckpointPersist: c.Cfg.LeaseCheckpointPersist,
WatchProgressNotifyInterval: c.Cfg.WatchProgressNotifyInterval,
ExperimentalMaxLearners: c.Cfg.ExperimentalMaxLearners,
DisableStrictReconfigCheck: c.Cfg.DisableStrictReconfigCheck,
CorruptCheckTime: c.Cfg.CorruptCheckTime,
Name: fmt.Sprintf("m%v", memberNumber),
MemberNumber: memberNumber,
AuthToken: c.Cfg.AuthToken,
AuthTokenTTL: c.Cfg.AuthTokenTTL,
PeerTLS: c.Cfg.PeerTLS,
ClientTLS: c.Cfg.ClientTLS,
QuotaBackendBytes: c.Cfg.QuotaBackendBytes,
MaxTxnOps: c.Cfg.MaxTxnOps,
MaxRequestBytes: c.Cfg.MaxRequestBytes,
SnapshotCount: c.Cfg.SnapshotCount,
SnapshotCatchUpEntries: c.Cfg.SnapshotCatchUpEntries,
GrpcKeepAliveMinTime: c.Cfg.GRPCKeepAliveMinTime,
GrpcKeepAliveInterval: c.Cfg.GRPCKeepAliveInterval,
GrpcKeepAliveTimeout: c.Cfg.GRPCKeepAliveTimeout,
ClientMaxCallSendMsgSize: c.Cfg.ClientMaxCallSendMsgSize,
ClientMaxCallRecvMsgSize: c.Cfg.ClientMaxCallRecvMsgSize,
UseIP: c.Cfg.UseIP,
UseBridge: c.Cfg.UseBridge,
UseTCP: c.Cfg.UseTCP,
EnableLeaseCheckpoint: c.Cfg.EnableLeaseCheckpoint,
LeaseCheckpointInterval: c.Cfg.LeaseCheckpointInterval,
LeaseCheckpointPersist: c.Cfg.LeaseCheckpointPersist,
WatchProgressNotifyInterval: c.Cfg.WatchProgressNotifyInterval,
ExperimentalMaxLearners: c.Cfg.ExperimentalMaxLearners,
DisableStrictReconfigCheck: c.Cfg.DisableStrictReconfigCheck,
CorruptCheckTime: c.Cfg.CorruptCheckTime,
ExperimentalStopGRPCServiceOnDefrag: c.Cfg.ExperimentalStopGRPCServiceOnDefrag,
})
m.DiscoveryURL = c.Cfg.DiscoveryURL
return m
Expand Down Expand Up @@ -614,6 +617,8 @@ type MemberConfig struct {
ExperimentalMaxLearners int
DisableStrictReconfigCheck bool
CorruptCheckTime time.Duration

ExperimentalStopGRPCServiceOnDefrag bool
}

// MustNewMember return an inited member with the given name. If peerTLS is
Expand Down Expand Up @@ -723,6 +728,7 @@ func MustNewMember(t testutil.TB, mcfg MemberConfig) *Member {
if mcfg.CorruptCheckTime > time.Duration(0) {
m.CorruptCheckTime = mcfg.CorruptCheckTime
}
m.ExperimentalStopGRPCServiceOnDefrag = mcfg.ExperimentalStopGRPCServiceOnDefrag
m.WarningApplyDuration = embed.DefaultWarningApplyDuration
m.WarningUnaryRequestDuration = embed.DefaultWarningUnaryRequestDuration
m.ExperimentalMaxLearners = membership.DefaultMaxLearners
Expand Down

0 comments on commit 913c825

Please sign in to comment.