Skip to content

Commit

Permalink
make test stable
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Jun 25, 2024
1 parent 6f1103a commit a91615b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/schedule/schedulers/hot_region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -781,8 +781,10 @@ func TestHotWriteRegionScheduleByteRateOnlyWithTiFlash(t *testing.T) {
allowLeaderTiKVCount := aliveTiKVCount - 1 // store 5 with evict leader
aliveTiFlashCount := float64(aliveTiFlashLastID - aliveTiFlashStartID + 1)
tc.ObserveRegionsStats()
ops, _ := hb.Schedule(tc, false)
re.NotEmpty(ops)
testutil.Eventually(re, func() bool {
ops, _ := hb.Schedule(tc, false)
return len(ops) != 0
})
re.True(
loadsEqual(
hb.stLoadInfos[writeLeader][1].LoadPred.Expect.Loads,
Expand All @@ -801,8 +803,10 @@ func TestHotWriteRegionScheduleByteRateOnlyWithTiFlash(t *testing.T) {
pdServerCfg.FlowRoundByDigit = 8
tc.SetPDServerConfig(pdServerCfg)
clearPendingInfluence(hb)
ops, _ = hb.Schedule(tc, false)
re.NotEmpty(ops)
testutil.Eventually(re, func() bool {
ops, _ := hb.Schedule(tc, false)
return len(ops) != 0
})
re.True(
loadsEqual(
hb.stLoadInfos[writePeer][8].LoadPred.Expect.Loads,
Expand Down
1 change: 1 addition & 0 deletions pkg/schedule/schedulers/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ func TestShuffleRegionRole(t *testing.T) {
}

func TestSpecialUseHotRegion(t *testing.T) {
schedulePeerPr = 1.0
re := require.New(t)
cancel, _, tc, oc := prepareSchedulersTest()
defer cancel()
Expand Down

0 comments on commit a91615b

Please sign in to comment.