From 692198378d623668c6b99fa899a4ba35ba911de5 Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Mon, 24 Feb 2025 14:23:36 +0000 Subject: [PATCH] Fix flaky TestLeaseKeepAliveSeconds Signed-off-by: Benjamin Wang --- tests/integration/clientv3/lease/lease_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/clientv3/lease/lease_test.go b/tests/integration/clientv3/lease/lease_test.go index 943a169e35d..eaf4a75ff59 100644 --- a/tests/integration/clientv3/lease/lease_test.go +++ b/tests/integration/clientv3/lease/lease_test.go @@ -189,7 +189,7 @@ func TestLeaseKeepAlive(t *testing.T) { } } -func TestLeaseKeepAliveOneSecond(t *testing.T) { +func TestLeaseKeepAliveSeconds(t *testing.T) { integration2.BeforeTest(t) clus := integration2.NewCluster(t, &integration2.ClusterConfig{Size: 1}) @@ -197,7 +197,7 @@ func TestLeaseKeepAliveOneSecond(t *testing.T) { cli := clus.Client(0) - resp, err := cli.Grant(context.Background(), 1) + resp, err := cli.Grant(context.Background(), 3) if err != nil { t.Errorf("failed to create lease %v", err) } @@ -208,7 +208,7 @@ func TestLeaseKeepAliveOneSecond(t *testing.T) { for i := 0; i < 3; i++ { if _, ok := <-rc; !ok { - t.Errorf("chan is closed, want not closed") + t.Errorf("[%d] chan is closed, want not closed", i) } } }