Skip to content

Commit

Permalink
storage: deflake TestStoreRangeUpReplicate
Browse files Browse the repository at this point in the history
The replica can appear before the reservation has been filled, so move
the check that the reservation count drops to 0 into the retry loop.

Fixes cockroachdb#10553
  • Loading branch information
petermattis committed Nov 9, 2016
1 parent 954063f commit a486f42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/storage/client_raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,9 @@ func TestStoreRangeUpReplicate(t *testing.T) {
if r == nil {
return errors.Errorf("expected replica for keys \"a\" - \"b\"")
}
if n := s.ReservationCount(); n != 0 {
return errors.Errorf("expected 0 reservations, but found %d", n)
}
}
return nil
})
Expand All @@ -965,9 +968,6 @@ func TestStoreRangeUpReplicate(t *testing.T) {
generated += m.RangeSnapshotsGenerated.Count()
normalApplied += m.RangeSnapshotsNormalApplied.Count()
preemptiveApplied += m.RangeSnapshotsPreemptiveApplied.Count()
if n := s.ReservationCount(); n != 0 {
t.Fatalf("expected 0 reservations, but found %d", n)
}
}
if generated == 0 {
t.Fatalf("expected at least 1 snapshot, but found 0")
Expand Down

0 comments on commit a486f42

Please sign in to comment.