Skip to content

Commit

Permalink
test-2
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Jan 14, 2025
1 parent 437b369 commit 40981b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions pkg/core/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,9 @@ func NewStoresInfo() *StoresInfo {
func (s *StoresInfo) GetStore(storeID uint64) *StoreInfo {
s.RLock()
defer s.RUnlock()
if s.stores == nil {
return nil
}
store, ok := s.stores[storeID]
if !ok {
return nil
Expand Down
3 changes: 2 additions & 1 deletion tests/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@ func MustPutStore(re *require.Assertions, cluster *TestCluster, store *metapb.St
ts = time.Now().UnixNano()
}
raftCluster := grpcServer.GetRaftCluster()
storeInfo := raftCluster.GetStore(store.GetId())
id := store.GetId()
storeInfo := raftCluster.GetStore(id)
newStore := storeInfo.Clone(
core.SetStoreStats(&pdpb.StoreStats{
Capacity: uint64(10 * units.GiB),
Expand Down

0 comments on commit 40981b4

Please sign in to comment.