Skip to content

Commit

Permalink
handle_test: fix unstable test in the TestConcurrentLoadHistTimeout (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-srebot authored Sep 22, 2022
1 parent 4f28cc6 commit c7f30c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions statistics/handle/handle_hist_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,14 @@ func TestConcurrentLoadHistTimeout(t *testing.T) {
topn = stat.Columns[tableInfo.Columns[2].ID].TopN
require.Equal(t, 0, hg.Len()+topn.Num())
// wait for timeout task to be handled
oldStat := stat
for {
time.Sleep(time.Millisecond * 100)
if len(h.StatsLoad.TimeoutColumnsCh)+len(h.StatsLoad.NeededColumnsCh) == 0 {
stat = h.GetTableStats(tableInfo)
if stat != oldStat {
break
}
}
stat = h.GetTableStats(tableInfo)
hg = stat.Columns[tableInfo.Columns[2].ID].Histogram
topn = stat.Columns[tableInfo.Columns[2].ID].TopN
require.Greater(t, hg.Len()+topn.Num(), 0)
Expand Down

0 comments on commit c7f30c1

Please sign in to comment.