mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
integration: test RejectOldCluster
This commit is contained in:
parent
4d2aa80ecf
commit
51435df179
@ -70,3 +70,21 @@ func testDialSetEndpoints(t *testing.T, setBefore bool) {
|
|||||||
}
|
}
|
||||||
cancel()
|
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()
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user