Skip to content

Commit

Permalink
use in other test
Browse files Browse the repository at this point in the history
Signed-off-by: lhy1024 <admin@liudos.us>
  • Loading branch information
lhy1024 committed Nov 30, 2023
1 parent 977d86a commit 12da5f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/pdctl/scheduler/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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",
Expand All @@ -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() {
Expand Down
4 changes: 2 additions & 2 deletions tests/server/api/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 12da5f4

Please sign in to comment.