Skip to content

Commit

Permalink
clientv3/integration: adjust timeouts for TestLeasingReconnectOwnerRe…
Browse files Browse the repository at this point in the history
…voke

Now Restart takes longer, and leasing Get blocks
on server restarts anyway, so fix CI failures in
slow machines.

Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Mar 6, 2018
1 parent 7c3a68b commit 1f03eea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions clientv3/integration/leasing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,7 @@ func TestLeasingReconnectOwnerRevoke(t *testing.T) {
// make lkv1 connection choppy so Txn fails
go func() {
defer close(sdonec)
for i := 0; i < 10 && cctx.Err() == nil; i++ {
for i := 0; i < 3 && cctx.Err() == nil; i++ {
clus.Members[0].Stop(t)
time.Sleep(10 * time.Millisecond)
clus.Members[0].Restart(t)
Expand All @@ -1396,6 +1396,7 @@ func TestLeasingReconnectOwnerRevoke(t *testing.T) {
if _, err := lkv2.Put(cctx, "k", "v"); err != nil {
t.Log(err)
}
// blocks until lkv1 connection comes back
resp, err := lkv1.Get(cctx, "k")
if err != nil {
t.Fatal(err)
Expand All @@ -1408,11 +1409,11 @@ func TestLeasingReconnectOwnerRevoke(t *testing.T) {
case <-pdonec:
cancel()
<-sdonec
case <-time.After(10 * time.Second):
case <-time.After(15 * time.Second):
cancel()
<-sdonec
<-pdonec
t.Fatal("took to long to revoke and put")
t.Fatal("took too long to revoke and put")
}
}

Expand Down

0 comments on commit 1f03eea

Please sign in to comment.