Skip to content

Commit

Permalink
fix conflict
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 committed Aug 9, 2023
1 parent c1ecc9d commit b00aef2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ require (
)

require (
github.com/google/go-cmp v0.5.9 // indirect
github.com/samber/lo v1.37.0 // indirect
gorm.io/datatypes v1.1.0 // indirect
)
Expand Down Expand Up @@ -115,7 +116,6 @@ require (
github.com/json-iterator/go v1.1.12 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/leodido/go-urn v1.2.0 // indirect
github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a // indirect
github.com/mailru/easyjson v0.7.6
github.com/mattn/go-colorable v0.1.8 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
Expand Down
3 changes: 0 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w=
github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY=
github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a/go.mod h1:JKx41uQRwqlTZabZc+kILPrO/3jlKnQ2Z8b7YiVw5cE=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
Expand Down
10 changes: 4 additions & 6 deletions server/api/region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ import (
"github.com/pingcap/kvproto/pkg/pdpb"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
"github.com/tikv/pd/pkg/core"
"github.com/tikv/pd/pkg/schedule/placement"
"github.com/tikv/pd/pkg/utils/apiutil"
tu "github.com/tikv/pd/pkg/utils/testutil"
"github.com/tikv/pd/pkg/apiutil"
tu "github.com/tikv/pd/pkg/testutil"
"github.com/tikv/pd/server"
"github.com/tikv/pd/server/core"
"github.com/tikv/pd/server/schedule/placement"
Expand Down Expand Up @@ -475,7 +473,7 @@ func TestRegionsWithKillRequest(t *testing.T) {
mustBootstrapCluster(re, svr)
regionCount := 100000
for i := 0; i < regionCount; i++ {
r := core.NewTestRegionInfo(uint64(i+2), 1,
r := core.NewTestRegionInfoWithID(uint64(i+2), 1,
[]byte(fmt.Sprintf("%09d", i)),
[]byte(fmt.Sprintf("%09d", i+1)),
core.SetApproximateKeys(10), core.SetApproximateSize(10))
Expand Down Expand Up @@ -864,7 +862,7 @@ func BenchmarkGetRegions(b *testing.B) {
mustBootstrapCluster(re, svr)
regionCount := 1000000
for i := 0; i < regionCount; i++ {
r := core.NewTestRegionInfo(uint64(i+2), 1,
r := core.NewTestRegionInfoWithID(uint64(i+2), 1,
[]byte(fmt.Sprintf("%09d", i)),
[]byte(fmt.Sprintf("%09d", i+1)),
core.SetApproximateKeys(10), core.SetApproximateSize(10))
Expand Down
16 changes: 16 additions & 0 deletions server/core/test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,22 @@ func NewTestRegionInfo(start, end []byte) *RegionInfo {
}}
}

// NewTestRegionInfoWithID creates a new RegionInfo for test purpose.
func NewTestRegionInfoWithID(regionID, storeID uint64, start, end []byte, opts ...RegionCreateOption) *RegionInfo {
leader := &metapb.Peer{
Id: regionID,
StoreId: storeID,
}
metaRegion := &metapb.Region{
Id: regionID,
StartKey: start,
EndKey: end,
Peers: []*metapb.Peer{leader},
RegionEpoch: &metapb.RegionEpoch{ConfVer: 1, Version: 1},
}
return NewRegionInfo(metaRegion, leader, opts...)
}

// NewStoreInfoWithDisk is created with all disk infos.
func NewStoreInfoWithDisk(id, used, available, capacity, regionSize uint64) *StoreInfo {
stats := &pdpb.StoreStats{}
Expand Down

0 comments on commit b00aef2

Please sign in to comment.