Skip to content

Commit

Permalink
integration: test UseLatestCluster
Browse files Browse the repository at this point in the history
  • Loading branch information
heyitsanthony committed Feb 17, 2017
1 parent 4d2aa80 commit fba1925
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions clientv3/integration/dial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,21 @@ func testDialSetEndpoints(t *testing.T, setBefore bool) {
}
cancel()
}

func TestLatestCluster(t *testing.T) {
defer testutil.AfterTest(t)
// 2 endpoints to test multi-endpoint Status
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 2})
defer clus.Terminate(t)

cfg := clientv3.Config{
Endpoints: []string{clus.Members[0].GRPCAddr(), clus.Members[1].GRPCAddr()},
DialTimeout: 5 * time.Second,
UseLatestCluster: true,
}
cli, err := clientv3.New(cfg)
if err != nil {
t.Fatal(err)
}
cli.Close()
}

0 comments on commit fba1925

Please sign in to comment.