Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
125129: kvserver: deflake TestLeaseRenewer r=arulajmani a=pav-kv

Fixes cockroachdb#125042
Epic: none
Release note: none

Co-authored-by: Pavel Kalinnikov <[email protected]>
  • Loading branch information
craig[bot] and pav-kv committed Jun 5, 2024
2 parents 530c55a + abd6eb5 commit cf1f468
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/kv/kvserver/replica_lease_renewal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cf1f468

Please sign in to comment.