Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
102765: kvserver: TestDecommission add extra debug error info r=erikgrinaker a=aliher1911

TestDecommission is failing due to some timing issue. This PR adds debugging info to test errors to expose how many retries are being made and if deadlock detector makes test sufficiently slow to break.

Release note: None

Touches cockroachdb#102743
Epic: None

Co-authored-by: Oleg Afanasyev <[email protected]>
  • Loading branch information
craig[bot] and aliher1911 committed May 7, 2023
2 parents 53abb2f + 81d2422 commit d737af9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/kv/kvserver/client_raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3300,7 +3300,9 @@ func TestDecommission(t *testing.T) {
require.NoError(t, err)

requireNoReplicas := func(storeID roachpb.StoreID, repFactor int) {
attempt := 0
testutils.SucceedsSoon(t, func() error {
attempt++
desc := tc.LookupRangeOrFatal(t, k)
for _, rDesc := range desc.Replicas().VoterDescriptors() {
store, err := tc.Servers[int(rDesc.NodeID-1)].Stores().GetStore(rDesc.StoreID)
Expand All @@ -3312,10 +3314,10 @@ func TestDecommission(t *testing.T) {
if sl := desc.Replicas().FilterToDescriptors(func(rDesc roachpb.ReplicaDescriptor) bool {
return rDesc.StoreID == storeID
}); len(sl) > 0 {
return errors.Errorf("still a replica on s%d: %s", storeID, &desc)
return errors.Errorf("still a replica on s%d: %s on attempt %d", storeID, &desc, attempt)
}
if len(desc.Replicas().VoterDescriptors()) != repFactor {
return errors.Errorf("expected %d replicas: %s", repFactor, &desc)
return errors.Errorf("expected %d replicas: %s on attempt %d", repFactor, &desc, attempt)
}
return nil
})
Expand Down

0 comments on commit d737af9

Please sign in to comment.