Skip to content

Commit

Permalink
Merge pull request #103102 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-22.2-103098

release-22.2: kvserver: deflake TestLeaseMetricsOnSplitAndTransfer
  • Loading branch information
erikgrinaker authored May 19, 2023
2 parents 2e910ee + f59e9fe commit f15f8f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/kv/kvserver/client_replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2109,8 +2109,11 @@ func TestLeaseMetricsOnSplitAndTransfer(t *testing.T) {
if a, e := metrics.LeaseTransferSuccessCount.Count(), int64(1); a != e {
t.Errorf("expected %d lease transfer successes; got %d", e, a)
}
if a, e := metrics.LeaseTransferErrorCount.Count(), int64(1); a != e {
t.Errorf("expected %d lease transfer errors; got %d", e, a)
// We mostly expect precisely one error, but there's a retry loop in
// `AdminTransferLease` that prevents transfers to followers who might need a
// snapshot. This can sometimes lead to additional errors being reported.
if a := metrics.LeaseTransferErrorCount.Count(); a == 0 {
t.Errorf("expected at least one lease transfer errors; got %d", a)
}

// Expire current leases and put a key to the epoch based scratch range to
Expand Down

0 comments on commit f15f8f4

Please sign in to comment.