Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
  • Loading branch information
CabinfeverB committed Jul 25, 2022
1 parent 32e3439 commit 3c7167c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions server/schedule/operator_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,9 @@ func (suite *operatorControllerTestSuite) TestCalcInfluence() {
stream := hbstream.NewTestHeartbeatStreams(suite.ctx, cluster.ID, cluster, false /* no need to run */)
controller := NewOperatorController(suite.ctx, cluster, stream)

// Create a new region with epoch(0, 0)
// the region has two peers with its peer id allocated incrementally.
// so the two peers are {peerid: 1, storeid: 1}, {peerid: 2, storeid: 2}
// The peer on store 1 is the leader
epoch := &metapb.RegionEpoch{ConfVer: 0, Version: 0}
region := cluster.MockRegionInfo(1, 1, []uint64{2}, []uint64{}, epoch)
region = region.Clone(core.SetApproximateSize(20))
// Put region into cluster, otherwise, AddOperator will fail because of
// missing region
cluster.PutRegion(region)
cluster.AddRegionStore(1, 1)
cluster.AddRegionStore(3, 1)
Expand Down Expand Up @@ -547,8 +541,7 @@ func (suite *operatorControllerTestSuite) TestCalcInfluence() {
core.WithIncConfVer(),
)
suite.True(steps[0].IsFinish(region2))
// push operator step
controller.Dispatch(region2, DispatchFromHeartBeat)
op.Check(region2)

influence = controller.GetOpInfluence(cluster)
check(influence, 1, &operator.StoreInfluence{
Expand Down

0 comments on commit 3c7167c

Please sign in to comment.