From 158a919ddfe421d02b21897e3dd9da340bc9d971 Mon Sep 17 00:00:00 2001 From: tangenta Date: Fri, 22 Jul 2022 14:34:53 +0800 Subject: [PATCH] test: stabilize TestTopSQLCPUProfile --- 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)