diff --git a/integration/cluster.go b/integration/cluster.go index ccd232f6f..b32895b96 100644 --- a/integration/cluster.go +++ b/integration/cluster.go @@ -117,17 +117,25 @@ func init() { } type ClusterConfig struct { - Size int - PeerTLS *transport.TLSInfo - ClientTLS *transport.TLSInfo - DiscoveryURL string - UseGRPC bool - QuotaBackendBytes int64 - MaxTxnOps uint - MaxRequestBytes uint + Size int + PeerTLS *transport.TLSInfo + ClientTLS *transport.TLSInfo + + DiscoveryURL 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 @@ -269,6 +277,8 @@ func (c *cluster) mustNewMember(t *testing.T) *member { 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, @@ -550,6 +560,8 @@ type memberConfig struct { quotaBackendBytes int64 maxTxnOps uint maxRequestBytes uint + snapshotCount uint64 + snapshotCatchUpEntries uint64 grpcKeepAliveMinTime time.Duration grpcKeepAliveInterval time.Duration grpcKeepAliveTimeout time.Duration @@ -612,6 +624,14 @@ func mustNewMember(t *testing.T, mcfg memberConfig) *member { if m.MaxRequestBytes == 0 { 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.BcryptCost = uint(bcrypt.MinCost) // use min bcrypt cost to speedy up integration testing diff --git a/integration/cluster_test.go b/integration/cluster_test.go index a706f0dd4..2e68c3286 100644 --- a/integration/cluster_test.go +++ b/integration/cluster_test.go @@ -251,7 +251,7 @@ func testIssue2746(t *testing.T, members int) { c := NewCluster(t, members) for _, m := range c.Members { - m.SnapCount = 10 + m.SnapshotCount = 10 } c.Launch(t) diff --git a/integration/member_test.go b/integration/member_test.go index a56dd4be8..97c84bb13 100644 --- a/integration/member_test.go +++ b/integration/member_test.go @@ -86,7 +86,7 @@ func TestLaunchDuplicateMemberShouldFail(t *testing.T) { func TestSnapshotAndRestartMember(t *testing.T) { defer testutil.AfterTest(t) m := mustNewMember(t, memberConfig{name: "snapAndRestartTest"}) - m.SnapCount = 100 + m.SnapshotCount = 100 m.Launch() defer m.Terminate(t) m.WaitOK(t)