Skip to content

Commit

Permalink
tests/integration/clientv3: allow time for endpoints to update
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
  • Loading branch information
hexfusion committed Oct 27, 2021
1 parent 316e62b commit a0bdfc4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/integration/clientv3/ordering_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -72,6 +73,7 @@ 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
_, err = orderingKv.Get(ctx, "foo", clientv3.WithSerializable())
if err != ordering.ErrNoGreaterRev {
t.Fatal("While speaking to partitioned leader, we should get ErrNoGreaterRev error")
Expand Down Expand Up @@ -140,6 +142,7 @@ func TestUnresolvableOrderViolation(t *testing.T) {
}
clus.Members[3].WaitStarted(t)
cli.SetEndpoints(clus.Members[3].GRPCURL())
time.Sleep(1 * time.Second) // give enough time for operation

_, err = OrderingKv.Get(ctx, "foo", clientv3.WithSerializable())
if err != ordering.ErrNoGreaterRev {
Expand Down

0 comments on commit a0bdfc4

Please sign in to comment.