From 9d4440d80a1ad55dfb2d9fccc4903a0489c6f00d Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Tue, 6 Mar 2018 02:38:18 -0800 Subject: [PATCH] clientv3/integration: adjust timeouts for TestLeasingReconnectOwnerRevoke Now Restart takes longer, and leasing Get blocks on server restarts anyway, so fix CI failures in slow machines. Signed-off-by: Gyuho Lee --- clientv3/integration/leasing_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/clientv3/integration/leasing_test.go b/clientv3/integration/leasing_test.go index b56478361d95..bfed1ea42210 100644 --- a/clientv3/integration/leasing_test.go +++ b/clientv3/integration/leasing_test.go @@ -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) @@ -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) @@ -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") } }