diff --git a/tests/framework/integration/cluster.go b/tests/framework/integration/cluster.go index 82d4a7b41..87e2bee45 100644 --- a/tests/framework/integration/cluster.go +++ b/tests/framework/integration/cluster.go @@ -1097,11 +1097,15 @@ func (m *Member) WaitStarted(t testutil.TB) { } func WaitClientV3(t testutil.TB, kv clientv3.KV) { + WaitClientV3WithKey(t, kv, "/") +} + +func WaitClientV3WithKey(t testutil.TB, kv clientv3.KV, key string) { timeout := time.Now().Add(RequestTimeout) var err error for time.Now().Before(timeout) { ctx, cancel := context.WithTimeout(context.Background(), RequestTimeout) - _, err = kv.Get(ctx, "/") + _, err = kv.Get(ctx, key) cancel() if err == nil { return diff --git a/tests/integration/v3_auth_test.go b/tests/integration/v3_auth_test.go index fd300ba78..28aadd385 100644 --- a/tests/integration/v3_auth_test.go +++ b/tests/integration/v3_auth_test.go @@ -492,6 +492,7 @@ func TestV3AuthRestartMember(t *testing.T) { clus.Members[0].Stop(t) err = clus.Members[0].Restart(t) testutil.AssertNil(t, err) + integration.WaitClientV3WithKey(t, c2.KV, "foo") // nothing has changed, but it fails without refreshing cache after restart _, err = c2.Put(context.TODO(), "foo", "bar2")