From e938e486aeb832c0dd414470429c96d7e7759dfb Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 21 Jun 2017 11:57:36 -0700 Subject: [PATCH] Revert "integration: remove lease exist checking on randomized expiry" This reverts commit 95bc33f37f7c31a4cd06287d44879a60baaee40c. The new lease extension algorithm should pass this test. --- integration/v3_lease_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/integration/v3_lease_test.go b/integration/v3_lease_test.go index b270e1c1b6be..7bb72ba131f8 100644 --- a/integration/v3_lease_test.go +++ b/integration/v3_lease_test.go @@ -66,10 +66,16 @@ func TestV3LeasePrmote(t *testing.T) { // it was going to expire anyway. time.Sleep(3 * time.Second) - // expiring lease should be renewed with randomized delta if !leaseExist(t, clus, lresp.ID) { t.Error("unexpected lease not exists") } + + // let lease expires. total lease = 5 seconds and we already + // waits for 3 seconds, so 3 seconds more is enough. + time.Sleep(3 * time.Second) + if leaseExist(t, clus, lresp.ID) { + t.Error("unexpected lease exists") + } } // TestV3LeaseRevoke ensures a key is deleted once its lease is revoked.