diff --git a/tests/pdctl/scheduler/scheduler_test.go b/tests/pdctl/scheduler/scheduler_test.go index f856a34024e..d8d54a79d13 100644 --- a/tests/pdctl/scheduler/scheduler_test.go +++ b/tests/pdctl/scheduler/scheduler_test.go @@ -23,6 +23,7 @@ import ( "testing" "time" + "github.com/pingcap/failpoint" "github.com/pingcap/kvproto/pkg/metapb" "github.com/spf13/cobra" "github.com/stretchr/testify/require" @@ -48,6 +49,7 @@ func TestSchedulerTestSuite(t *testing.T) { } func (suite *schedulerTestSuite) SetupSuite() { + suite.NoError(failpoint.Enable("github.com/tikv/pd/server/cluster/skipStoreConfigSync", `return(true)`)) suite.env = tests.NewSchedulingTestEnvironment(suite.T()) suite.defaultSchedulers = []string{ "balance-leader-scheduler", @@ -60,6 +62,7 @@ func (suite *schedulerTestSuite) SetupSuite() { func (suite *schedulerTestSuite) TearDownSuite() { suite.env.Cleanup() + suite.NoError(failpoint.Disable("github.com/tikv/pd/server/cluster/skipStoreConfigSync")) } func (suite *schedulerTestSuite) TearDownTest() { diff --git a/tests/server/api/scheduler_test.go b/tests/server/api/scheduler_test.go index 4485d99129c..77dd22a006e 100644 --- a/tests/server/api/scheduler_test.go +++ b/tests/server/api/scheduler_test.go @@ -48,11 +48,13 @@ func TestScheduleTestSuite(t *testing.T) { } func (suite *scheduleTestSuite) SetupSuite() { + suite.NoError(failpoint.Enable("github.com/tikv/pd/server/cluster/skipStoreConfigSync", `return(true)`)) suite.env = tests.NewSchedulingTestEnvironment(suite.T()) } func (suite *scheduleTestSuite) TearDownSuite() { suite.env.Cleanup() + suite.NoError(failpoint.Disable("github.com/tikv/pd/server/cluster/skipStoreConfigSync")) } func (suite *scheduleTestSuite) TestOriginAPI() { @@ -574,9 +576,7 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) { } func (suite *scheduleTestSuite) TestDisable() { - suite.NoError(failpoint.Enable("github.com/tikv/pd/server/cluster/skipStoreConfigSync", `return(true)`)) suite.env.RunTestInTwoModes(suite.checkDisable) - suite.NoError(failpoint.Disable("github.com/tikv/pd/server/cluster/skipStoreConfigSync")) } func (suite *scheduleTestSuite) checkDisable(cluster *tests.TestCluster) {