Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <[email protected]>
  • Loading branch information
Yisaer committed May 10, 2021
1 parent 7d82d39 commit b7039c6
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/pdctl/hot/hot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,23 @@ func (s *hotTestSuite) TestHot(c *C) {
statistics.ReadReportInterval * 2,
statistics.ReadReportInterval*2 + 1,
}
for _, reportInterval := range reportIntervals {
hotReadRegionID, hotWriteRegionID := reportInterval, reportInterval+100
if hotType == "read" {
pdctl.MustPutRegion(c, cluster, hotReadRegionID, hotStoreID, []byte("b"), []byte("c"), core.SetReadBytes(1000000000), core.SetReportInterval(reportInterval))
} else {
pdctl.MustPutRegion(c, cluster, hotWriteRegionID, hotStoreID, []byte("c"), []byte("d"), core.SetWrittenBytes(1000000000), core.SetReportInterval(reportInterval))
}
time.Sleep(5000 * time.Millisecond)
expectInterval := statistics.WriteReportInterval
if hotType == "read" {
expectInterval = statistics.ReadReportInterval
}
if reportInterval >= uint64(expectInterval) {
count++
}
testHot(hotReadRegionID, hotStoreID, hotType)
}
for _, reportInterval := range reportIntervals {
hotReadRegionID, hotWriteRegionID := reportInterval, reportInterval+100
if hotType == "read" {
pdctl.MustPutRegion(c, cluster, hotReadRegionID, hotStoreID, []byte("b"), []byte("c"), core.SetReadBytes(1000000000), core.SetReportInterval(reportInterval))
} else {
pdctl.MustPutRegion(c, cluster, hotWriteRegionID, hotStoreID, []byte("c"), []byte("d"), core.SetWrittenBytes(1000000000), core.SetReportInterval(reportInterval))
}
time.Sleep(5000 * time.Millisecond)
expectInterval := statistics.WriteReportInterval
if hotType == "read" {
expectInterval = statistics.ReadReportInterval
}
if reportInterval >= uint64(expectInterval) {
count++
}
testHot(hotReadRegionID, hotStoreID, hotType)
}
}
testInterval("read")
Expand Down

0 comments on commit b7039c6

Please sign in to comment.