diff --git a/pkg/statistics/handle/autoanalyze/refresher/refresher_test.go b/pkg/statistics/handle/autoanalyze/refresher/refresher_test.go index 3d7d4a0c4380e..70f813780c5cf 100644 --- a/pkg/statistics/handle/autoanalyze/refresher/refresher_test.go +++ b/pkg/statistics/handle/autoanalyze/refresher/refresher_test.go @@ -179,10 +179,11 @@ func insertFailedJobForPartitionWithStartTime( } func TestRebuildTableAnalysisJobQueue(t *testing.T) { - exec.AutoAnalyzeMinCnt = 0 + old := exec.AutoAnalyzeMinCnt defer func() { - exec.AutoAnalyzeMinCnt = 1000 + exec.AutoAnalyzeMinCnt = old }() + exec.AutoAnalyzeMinCnt = 0 store, dom := testkit.CreateMockStoreAndDomain(t) tk := testkit.NewTestKit(t, store) tk.MustExec("use test")