integration: rename "SnapshotCount"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee
2018-05-18 14:41:30 -07:00
parent 5235fc2106
commit aa99ed54b7
3 changed files with 30 additions and 10 deletions

View File

@ -117,17 +117,25 @@ func init() {
} }
type ClusterConfig struct { type ClusterConfig struct {
Size int Size int
PeerTLS *transport.TLSInfo PeerTLS *transport.TLSInfo
ClientTLS *transport.TLSInfo ClientTLS *transport.TLSInfo
DiscoveryURL string
UseGRPC bool DiscoveryURL string
QuotaBackendBytes int64
MaxTxnOps uint UseGRPC bool
MaxRequestBytes uint
QuotaBackendBytes int64
MaxTxnOps uint
MaxRequestBytes uint
SnapshotCount uint64
SnapshotCatchUpEntries uint64
GRPCKeepAliveMinTime time.Duration GRPCKeepAliveMinTime time.Duration
GRPCKeepAliveInterval time.Duration GRPCKeepAliveInterval time.Duration
GRPCKeepAliveTimeout time.Duration GRPCKeepAliveTimeout time.Duration
// SkipCreatingClient to skip creating clients for each member. // SkipCreatingClient to skip creating clients for each member.
SkipCreatingClient bool SkipCreatingClient bool
@ -269,6 +277,8 @@ func (c *cluster) mustNewMember(t *testing.T) *member {
quotaBackendBytes: c.cfg.QuotaBackendBytes, quotaBackendBytes: c.cfg.QuotaBackendBytes,
maxTxnOps: c.cfg.MaxTxnOps, maxTxnOps: c.cfg.MaxTxnOps,
maxRequestBytes: c.cfg.MaxRequestBytes, maxRequestBytes: c.cfg.MaxRequestBytes,
snapshotCount: c.cfg.SnapshotCount,
snapshotCatchUpEntries: c.cfg.SnapshotCatchUpEntries,
grpcKeepAliveMinTime: c.cfg.GRPCKeepAliveMinTime, grpcKeepAliveMinTime: c.cfg.GRPCKeepAliveMinTime,
grpcKeepAliveInterval: c.cfg.GRPCKeepAliveInterval, grpcKeepAliveInterval: c.cfg.GRPCKeepAliveInterval,
grpcKeepAliveTimeout: c.cfg.GRPCKeepAliveTimeout, grpcKeepAliveTimeout: c.cfg.GRPCKeepAliveTimeout,
@ -550,6 +560,8 @@ type memberConfig struct {
quotaBackendBytes int64 quotaBackendBytes int64
maxTxnOps uint maxTxnOps uint
maxRequestBytes uint maxRequestBytes uint
snapshotCount uint64
snapshotCatchUpEntries uint64
grpcKeepAliveMinTime time.Duration grpcKeepAliveMinTime time.Duration
grpcKeepAliveInterval time.Duration grpcKeepAliveInterval time.Duration
grpcKeepAliveTimeout time.Duration grpcKeepAliveTimeout time.Duration
@ -612,6 +624,14 @@ func mustNewMember(t *testing.T, mcfg memberConfig) *member {
if m.MaxRequestBytes == 0 { if m.MaxRequestBytes == 0 {
m.MaxRequestBytes = embed.DefaultMaxRequestBytes m.MaxRequestBytes = embed.DefaultMaxRequestBytes
} }
m.SnapshotCount = etcdserver.DefaultSnapshotCount
if mcfg.snapshotCount != 0 {
m.SnapshotCount = mcfg.snapshotCount
}
m.SnapshotCatchUpEntries = etcdserver.DefaultSnapshotCatchUpEntries
if mcfg.snapshotCatchUpEntries != 0 {
m.SnapshotCatchUpEntries = mcfg.snapshotCatchUpEntries
}
m.AuthToken = "simple" // for the purpose of integration testing, simple token is enough m.AuthToken = "simple" // for the purpose of integration testing, simple token is enough
m.BcryptCost = uint(bcrypt.MinCost) // use min bcrypt cost to speedy up integration testing m.BcryptCost = uint(bcrypt.MinCost) // use min bcrypt cost to speedy up integration testing

View File

@ -251,7 +251,7 @@ func testIssue2746(t *testing.T, members int) {
c := NewCluster(t, members) c := NewCluster(t, members)
for _, m := range c.Members { for _, m := range c.Members {
m.SnapCount = 10 m.SnapshotCount = 10
} }
c.Launch(t) c.Launch(t)

View File

@ -86,7 +86,7 @@ func TestLaunchDuplicateMemberShouldFail(t *testing.T) {
func TestSnapshotAndRestartMember(t *testing.T) { func TestSnapshotAndRestartMember(t *testing.T) {
defer testutil.AfterTest(t) defer testutil.AfterTest(t)
m := mustNewMember(t, memberConfig{name: "snapAndRestartTest"}) m := mustNewMember(t, memberConfig{name: "snapAndRestartTest"})
m.SnapCount = 100 m.SnapshotCount = 100
m.Launch() m.Launch()
defer m.Terminate(t) defer m.Terminate(t)
m.WaitOK(t) m.WaitOK(t)