From 9fb60deb7c42d25e02acafab8c5a0867eb30fcce Mon Sep 17 00:00:00 2001 From: Gyu-Ho Lee Date: Wed, 23 Mar 2016 16:28:05 -0700 Subject: [PATCH] functional-tester: add GRPCURLs for cluster config GRPC and v2 client address share the same host(port) but GRPC does not work with schema specified. This fixes it by adding another member for GRPC without schema, as we had before. --- tools/functional-tester/etcd-tester/cluster.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/functional-tester/etcd-tester/cluster.go b/tools/functional-tester/etcd-tester/cluster.go index 4338fe442..5d578ba90 100644 --- a/tools/functional-tester/etcd-tester/cluster.go +++ b/tools/functional-tester/etcd-tester/cluster.go @@ -44,6 +44,7 @@ type cluster struct { Agents []client.Agent Stressers []Stresser Names []string + GRPCURLs []string ClientURLs []string } @@ -158,6 +159,7 @@ func (c *cluster) Bootstrap() error { c.Agents = agents c.Stressers = stressers c.Names = names + c.GRPCURLs = grpcURLs c.ClientURLs = clientURLs return nil } @@ -168,7 +170,7 @@ func (c *cluster) WaitHealth() error { // TODO: set it to a reasonable value. It is set that high because // follower may use long time to catch up the leader when reboot under // reasonable workload (https://github.com/coreos/etcd/issues/2698) - healthFunc, urls := setHealthKey, c.ClientURLs + healthFunc, urls := setHealthKey, c.GRPCURLs if c.v2Only { healthFunc, urls = setHealthKeyV2, c.ClientURLs } @@ -188,7 +190,7 @@ func (c *cluster) GetLeader() (int, error) { return 0, nil } cli, err := clientv3.New(clientv3.Config{ - Endpoints: c.ClientURLs, + Endpoints: c.GRPCURLs, DialTimeout: 5 * time.Second, }) if err != nil { @@ -300,7 +302,7 @@ func setHealthKeyV2(us []string) error { func (c *cluster) getRevisionHash() (map[string]int64, map[string]int64, error) { revs := make(map[string]int64) hashes := make(map[string]int64) - for _, u := range c.ClientURLs { + for _, u := range c.GRPCURLs { conn, err := grpc.Dial(u, grpc.WithInsecure(), grpc.WithTimeout(5*time.Second)) if err != nil { return nil, nil, err @@ -324,7 +326,7 @@ func (c *cluster) compactKV(rev int64) error { conn *grpc.ClientConn err error ) - for _, u := range c.ClientURLs { + for _, u := range c.GRPCURLs { conn, err = grpc.Dial(u, grpc.WithInsecure(), grpc.WithTimeout(5*time.Second)) if err != nil { continue