Skip to content

Commit

Permalink
cherry pick pingcap#36468 to release-6.2
Browse files Browse the repository at this point in the history
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
  • Loading branch information
tangenta authored and ti-srebot committed Jul 22, 2022
1 parent 08e450c commit b1f03a0
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions server/tidb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1412,10 +1412,7 @@ func TestTopSQLCPUProfile(t *testing.T) {
dbt.MustExec("create table t2 (a int auto_increment, b int, unique index idx(a));")
dbt.MustExec("set @@global.tidb_txn_mode = 'pessimistic'")

timeoutCtx, cancel := context.WithTimeout(context.Background(), time.Second*20)
defer cancel()
checkFn := func(sql, planRegexp string) {
require.NoError(t, timeoutCtx.Err())
stats := mc.GetSQLStatsBySQLWithRetry(sql, len(planRegexp) > 0)
// since 1 sql may has many plan, check `len(stats) > 0` instead of `len(stats) == 1`.
require.Greaterf(t, len(stats), 0, "sql: "+sql)
Expand Down

0 comments on commit b1f03a0

Please sign in to comment.