From abd6eb5bd376acba72bddce9f09aa7fea6ec4f35 Mon Sep 17 00:00:00 2001 From: Pavel Kalinnikov Date: Wed, 5 Jun 2024 13:05:59 +0100 Subject: [PATCH] kvserver: deflake TestLeaseRenewer Epic: none Release note: none --- pkg/kv/kvserver/replica_lease_renewal_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/kv/kvserver/replica_lease_renewal_test.go b/pkg/kv/kvserver/replica_lease_renewal_test.go index 884e67d04462..791d77a934ae 100644 --- a/pkg/kv/kvserver/replica_lease_renewal_test.go +++ b/pkg/kv/kvserver/replica_lease_renewal_test.go @@ -122,11 +122,13 @@ func TestLeaseRenewer(t *testing.T) { // Split off an expiration-based range, and assert that the lease is extended. desc := tc.LookupRangeOrFatal(t, tc.ScratchRangeWithExpirationLease(t)) + // Wait for the split to apply on all nodes first. + require.NoError(t, tc.WaitForFullReplication()) + // Assert that the lease is extended. assertLeaseExtension(desc.RangeID) // Transfer the lease to a different leaseholder, and assert that the lease is - // still extended. Wait for the split to apply on all nodes first. - require.NoError(t, tc.WaitForFullReplication()) + // still extended. lease, _ := getNodeReplica(1, desc.RangeID).GetLease() target := tc.Target(lookupNode(lease.Replica.NodeID%3 + 1)) tc.TransferRangeLeaseOrFatal(t, desc, target)