Skip to content

Commit

Permalink
*: fix TestStatsLockAndUnlockTables (#45858)
Browse files Browse the repository at this point in the history
close #45843
  • Loading branch information
hawkingrei authored Aug 7, 2023
1 parent 585441a commit c512ede
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions statistics/handle/handletest/statslock/stats_lcok_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package statslock
import (
"strconv"
"testing"
"time"

"github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/domain"
Expand Down Expand Up @@ -98,11 +99,15 @@ func TestStatsLockAndUnlockTables(t *testing.T) {
handle := domain.GetDomain(tk.Session()).StatsHandle()
tbl1Stats := handle.GetTableStats(tbl1.Meta())
for _, col := range tbl1Stats.Columns {
require.True(t, col.IsStatsInitialized())
require.Eventually(t, func() bool {
return col.IsStatsInitialized()
}, 1*time.Second, 100*time.Millisecond)
}
tbl2Stats := handle.GetTableStats(tbl2.Meta())
for _, col := range tbl2Stats.Columns {
require.True(t, col.IsStatsInitialized())
require.Eventually(t, func() bool {
return col.IsStatsInitialized()
}, 1*time.Second, 100*time.Millisecond)
}

tk.MustExec("lock stats t1, t2")
Expand Down

0 comments on commit c512ede

Please sign in to comment.