浏览代码

integration: remove lease exist checking on randomized expiry

Lease with TTL 5 should be renewed with randomization,
thus it's still possible to exist after 3 seconds.

Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Gyu-Ho Lee 8 年之前
父节点
当前提交
95bc33f37f
共有 1 个文件被更改,包括 1 次插入7 次删除
  1. 1 7
      integration/v3_lease_test.go

+ 1 - 7
integration/v3_lease_test.go

@@ -66,16 +66,10 @@ 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.