Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Jul 30, 2021
1 parent 650207a commit f4c9402
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/schedulers/hot_region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ func (s *testHotReadRegionSchedulerSuite) TestByteRateOnly(c *C) {
tc.DisableFeature(versioninfo.JointConsensus)
hb, err := schedule.CreateScheduler(HotReadRegionType, schedule.NewOperatorController(ctx, nil, nil), core.NewStorage(kv.NewMemoryKV()), nil)
c.Assert(err, IsNil)
hb.(*hotScheduler).conf.ReadPriorities = []string{BytePriority, KeyPriority}
tc.SetHotRegionCacheHitsThreshold(0)

// Add stores 1, 2, 3, 4, 5 with region counts 3, 2, 2, 2, 0.
Expand Down Expand Up @@ -790,6 +791,7 @@ func (s *testHotReadRegionSchedulerSuite) TestWithKeyRate(c *C) {
c.Assert(err, IsNil)
hb.(*hotScheduler).conf.SetSrcToleranceRatio(1)
hb.(*hotScheduler).conf.SetDstToleranceRatio(1)
hb.(*hotScheduler).conf.ReadPriorities = []string{BytePriority, KeyPriority}

tc := mockcluster.NewCluster(ctx, opt)
tc.SetHotRegionCacheHitsThreshold(0)
Expand Down Expand Up @@ -1435,6 +1437,7 @@ func (s *testHotSchedulerSuite) TestHotReadPeerSchedule(c *C) {
sche, err := schedule.CreateScheduler(HotReadRegionType, schedule.NewOperatorController(ctx, tc, nil), core.NewStorage(kv.NewMemoryKV()), schedule.ConfigJSONDecoder([]byte("null")))
c.Assert(err, IsNil)
hb := sche.(*hotScheduler)
hb.conf.ReadPriorities = []string{BytePriority, KeyPriority}

tc.UpdateStorageReadStats(1, 20*MB, 20*MB)
tc.UpdateStorageReadStats(2, 19*MB, 19*MB)
Expand Down

0 comments on commit f4c9402

Please sign in to comment.