mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Fix the failure in TestEndpointSwitchResolvesViolation
Refer to a0bdfc4fc9
Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
@@ -62,6 +62,7 @@ func TestEndpointSwitchResolvesViolation(t *testing.T) {
|
||||
}
|
||||
|
||||
cli.SetEndpoints(eps...)
|
||||
time.Sleep(1 * time.Second) // give enough time for the operation
|
||||
orderingKv := ordering.NewKV(cli.KV, ordering.NewOrderViolationSwitchEndpointClosure(cli))
|
||||
// set prevRev to the second member's revision of "foo" such that
|
||||
// the revision is higher than the third member's revision of "foo"
|
||||
@@ -72,9 +73,11 @@ func TestEndpointSwitchResolvesViolation(t *testing.T) {
|
||||
|
||||
t.Logf("Reconfigure client to speak only to the 'partitioned' member")
|
||||
cli.SetEndpoints(clus.Members[2].GRPCURL())
|
||||
time.Sleep(1 * time.Second) // give enough time for the operation
|
||||
t.Log("Getting data from the partitioned member...")
|
||||
_, err = orderingKv.Get(ctx, "foo", clientv3.WithSerializable())
|
||||
if err != ordering.ErrNoGreaterRev {
|
||||
t.Fatal("While speaking to partitioned leader, we should get ErrNoGreaterRev error")
|
||||
t.Fatalf("While speaking to partitioned leader, we should get ErrNoGreaterRev error, %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user