From 12da5f43435e98ae9b708034d6fb626ad642fba9 Mon Sep 17 00:00:00 2001 From: lhy1024 Date: Thu, 30 Nov 2023 14:55:14 +0800 Subject: [PATCH] use in other test Signed-off-by: lhy1024 --- tests/pdctl/scheduler/scheduler_test.go | 3 +++ tests/server/api/scheduler_test.go | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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) {