Skip to content

Commit

Permalink
Fix the check
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed May 22, 2024
1 parent 43aa936 commit 602e088
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/core/region.go
Original file line number Diff line number Diff line change
Expand Up @@ -1680,10 +1680,11 @@ func (r *RegionsInfo) RandPendingRegions(storeID uint64, ranges []KeyRange) []*R
return r.pendingPeers[storeID].RandomRegions(randomRegionMaxRetry, ranges)
}

func (r *RegionsInfo) randLeaderRegion(storeID uint64, ranges []KeyRange) *RegionInfo {
// This function is used for test only.
func (r *RegionsInfo) randLeaderRegion(storeID uint64, ranges []KeyRange) {

Check warning on line 1684 in pkg/core/region.go

View check run for this annotation

Codecov / codecov/patch

pkg/core/region.go#L1684

Added line #L1684 was not covered by tests
r.st.RLock()
defer r.st.RUnlock()
return r.leaders[storeID].randomRegion(ranges)
_ = r.leaders[storeID].randomRegion(ranges)

Check warning on line 1687 in pkg/core/region.go

View check run for this annotation

Codecov / codecov/patch

pkg/core/region.go#L1687

Added line #L1687 was not covered by tests
}

// RandLeaderRegions randomly gets a store's n leader regions.
Expand Down

0 comments on commit 602e088

Please sign in to comment.