clientv3/integration: fix member remove
Do not connect to the member to remove.
This commit is contained in:
@ -67,7 +67,7 @@ func TestMemberRemove(t *testing.T) {
|
|||||||
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 3})
|
clus := integration.NewClusterV3(t, &integration.ClusterConfig{Size: 3})
|
||||||
defer clus.Terminate(t)
|
defer clus.Terminate(t)
|
||||||
|
|
||||||
capi := clientv3.NewCluster(clus.RandClient())
|
capi := clientv3.NewCluster(clus.Client(1))
|
||||||
resp, err := capi.MemberList(context.Background())
|
resp, err := capi.MemberList(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to list member %v", err)
|
t.Fatalf("failed to list member %v", err)
|
||||||
|
@ -696,3 +696,7 @@ func (c *ClusterV3) Terminate(t *testing.T) {
|
|||||||
func (c *ClusterV3) RandClient() *clientv3.Client {
|
func (c *ClusterV3) RandClient() *clientv3.Client {
|
||||||
return c.clients[rand.Intn(len(c.clients))]
|
return c.clients[rand.Intn(len(c.clients))]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *ClusterV3) Client(i int) *clientv3.Client {
|
||||||
|
return c.clients[i]
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user