From b1f03a0f1f2bcd2480967e38cb0355b4b1fdae6a Mon Sep 17 00:00:00 2001 From: tangenta Date: Fri, 22 Jul 2022 18:29:08 +0800 Subject: [PATCH] cherry pick #36468 to release-6.2 Signed-off-by: ti-srebot --- server/tidb_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/server/tidb_test.go b/server/tidb_test.go index b6b40b605c5e0..47f5a045a20b1 100644 --- a/server/tidb_test.go +++ b/server/tidb_test.go @@ -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)