Fix the failure in TestEndpointSwitchResolvesViolation

Refer to a0bdfc4fc9

Signed-off-by: Benjamin Wang <wachao@vmware.com>
This commit is contained in:
Benjamin Wang
2022-08-05 10:12:16 +08:00
parent 2751c61f24
commit 8c5f110b59

View File

@@ -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)
}
}