Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
97636: kvserver: fix TestStoreRangeReadoptedLHSFollower flakiness r=tbg a=aliher1911

Added retry for the case where snapshot is still in flight.

Release note: None

Fixes cockroachdb#96986

Co-authored-by: Oleg Afanasyev <[email protected]>
  • Loading branch information
craig[bot] and aliher1911 committed Feb 27, 2023
2 parents 13c58f6 + 283f381 commit afb6820
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/kv/kvserver/client_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3160,7 +3160,13 @@ func TestStoreRangeReadoptedLHSFollower(t *testing.T) {
}
return nil
})
tc.RemoveVotersOrFatal(t, lhsDesc.StartKey.AsRawKey(), tc.Target(2))
// Need to retry because removing voters could fail while snapshots are
// still in flight and cause "cannot remove learner while snapshot is in
// flight" error.
testutils.SucceedsSoon(t, func() error {
_, err := tc.RemoveVoters(lhsDesc.StartKey.AsRawKey(), tc.Target(2))
return err
})

if withMerge {
// Merge the two ranges together.
Expand Down

0 comments on commit afb6820

Please sign in to comment.