Skip to content

Commit

Permalink
integration: test RejectOldCluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Romano committed Feb 17, 2017
1 parent 4d2aa80 commit 51435df
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 TestRejectOldCluster(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,
RejectOldCluster: true,
}
cli, err := clientv3.New(cfg)
if err != nil {
t.Fatal(err)
}
cli.Close()
}

0 comments on commit 51435df

Please sign in to comment.