From f2f6bbbd966ec4b6bc8c08eec973a3c6e531b428 Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Thu, 1 Sep 2016 07:40:48 -0700 Subject: [PATCH] integration: configure AutoSync clientv3 --- integration/cluster.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/integration/cluster.go b/integration/cluster.go index ab4832d0a85c..bcb67547bb9b 100644 --- a/integration/cluster.go +++ b/integration/cluster.go @@ -82,6 +82,7 @@ type ClusterConfig struct { DiscoveryURL string UseGRPC bool QuotaBackendBytes int64 + ClientAutoSync time.Duration } type cluster struct { @@ -214,6 +215,7 @@ func (c *cluster) mustNewMember(t *testing.T) *member { peerTLS: c.cfg.PeerTLS, clientTLS: c.cfg.ClientTLS, quotaBackendBytes: c.cfg.QuotaBackendBytes, + clientAutoSync: c.cfg.ClientAutoSync, }) m.DiscoveryURL = c.cfg.DiscoveryURL if c.cfg.UseGRPC { @@ -439,7 +441,8 @@ type member struct { // PeerTLSInfo enables peer TLS when set PeerTLSInfo *transport.TLSInfo // ClientTLSInfo enables client TLS when set - ClientTLSInfo *transport.TLSInfo + ClientTLSInfo *transport.TLSInfo + clientAutoSync time.Duration raftHandler *testutil.PauseableHandler s *etcdserver.EtcdServer @@ -457,6 +460,7 @@ type memberConfig struct { peerTLS *transport.TLSInfo clientTLS *transport.TLSInfo quotaBackendBytes int64 + clientAutoSync time.Duration } // mustNewMember return an inited member with the given name. If peerTLS is @@ -484,6 +488,8 @@ func mustNewMember(t *testing.T, mcfg memberConfig) *member { } m.ClientTLSInfo = mcfg.clientTLS + m.clientAutoSync = mcfg.clientAutoSync + m.Name = mcfg.name m.DataDir, err = ioutil.TempDir(os.TempDir(), "etcd") @@ -540,6 +546,7 @@ func NewClientV3(m *member) (*clientv3.Client, error) { cfg := clientv3.Config{ Endpoints: []string{m.grpcAddr}, DialTimeout: 5 * time.Second, + AutoSync: m.clientAutoSync, } if m.ClientTLSInfo != nil { @@ -581,6 +588,7 @@ func (m *member) Clone(t *testing.T) *member { mm.ElectionTicks = m.ElectionTicks mm.PeerTLSInfo = m.PeerTLSInfo mm.ClientTLSInfo = m.ClientTLSInfo + mm.clientAutoSync = m.clientAutoSync return mm }