Skip to content

Commit

Permalink
integration: add 'NoClient' to 'ClusterV3'
Browse files Browse the repository at this point in the history
Useful for custom clientv3 settings.

Signed-off-by: Gyu-Ho Lee <[email protected]>
  • Loading branch information
gyuho committed Oct 9, 2017
1 parent b4a7859 commit 6cd263b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions integration/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ type ClusterConfig struct {
ClientTLS *transport.TLSInfo
DiscoveryURL string
UseGRPC bool
NoClient bool
QuotaBackendBytes int64
MaxTxnOps uint
MaxRequestBytes uint
Expand Down Expand Up @@ -986,14 +987,15 @@ func NewClusterV3(t *testing.T, cfg *ClusterConfig) *ClusterV3 {
cluster: NewClusterByConfig(t, cfg),
}
clus.Launch(t)
for _, m := range clus.Members {
client, err := NewClientV3(m)
if err != nil {
t.Fatalf("cannot create client: %v", err)
if !cfg.NoClient {
for _, m := range clus.Members {
client, err := NewClientV3(m)
if err != nil {
t.Fatalf("cannot create client: %v", err)
}
clus.clients = append(clus.clients, client)
}
clus.clients = append(clus.clients, client)
}

return clus
}

Expand Down

0 comments on commit 6cd263b

Please sign in to comment.