diff --git a/server/api/diagnostic_test.go b/server/api/diagnostic_test.go index 3ff1cd20b22..f58360cc852 100644 --- a/server/api/diagnostic_test.go +++ b/server/api/diagnostic_test.go @@ -57,6 +57,7 @@ func (suite *diagnosticTestSuite) SetupSuite() { mustBootstrapCluster(re, suite.svr) mustPutStore(re, suite.svr, 1, metapb.StoreState_Up, metapb.NodeState_Serving, nil) mustPutStore(re, suite.svr, 2, metapb.StoreState_Up, metapb.NodeState_Serving, nil) + suite.svr.GetRaftCluster().GetCoordinator().GetPrepareChecker().SetPrepared() } func (suite *diagnosticTestSuite) TearDownSuite() { diff --git a/server/cluster/cluster_test.go b/server/cluster/cluster_test.go index b2a7548eed9..8715419f36d 100644 --- a/server/cluster/cluster_test.go +++ b/server/cluster/cluster_test.go @@ -2989,6 +2989,8 @@ func TestScanLimit(t *testing.T) { func checkScanLimit(re *require.Assertions, regionCount int, expectScanLimit ...int) { tc, co, cleanup := prepare(nil, nil, nil, re) defer cleanup() + // set prepared to avoid prepare checker block the patrol + co.GetPrepareChecker().SetPrepared() re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/schedule/checker/breakPatrol", `return`)) re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/schedule/checker/regionCount", fmt.Sprintf("return(\"%d\")", regionCount))) defer func() {