Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: fix disable failpoint #6412

Merged
merged 3 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/schedule/operator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ func (oc *OperatorController) Dispatch(region *core.RegionInfo, source string) {
failpoint.Inject("concurrentRemoveOperator", func() {
time.Sleep(500 * time.Millisecond)
})

// Update operator status:
// The operator status should be STARTED.
// Check will call CheckSuccess and CheckTimeout.
Expand Down
3 changes: 1 addition & 2 deletions pkg/schedule/operator_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ func (suite *operatorControllerTestSuite) TestConcurrentRemoveOperator() {
oc.SetOperator(op1)

suite.NoError(failpoint.Enable("github.com/tikv/pd/pkg/schedule/concurrentRemoveOperator", "return(true)"))
defer suite.NoError(failpoint.Disable("github.com/tikv/pd/pkg/schedule/concurrentRemoveOperator"))

var wg sync.WaitGroup
wg.Add(2)
go func() {
Expand All @@ -324,6 +322,7 @@ func (suite *operatorControllerTestSuite) TestConcurrentRemoveOperator() {
wg.Wait()

suite.Equal(op2, oc.GetOperator(1))
suite.NoError(failpoint.Disable("github.com/tikv/pd/pkg/schedule/concurrentRemoveOperator"))
}

func (suite *operatorControllerTestSuite) TestPollDispatchRegion() {
Expand Down
4 changes: 2 additions & 2 deletions server/region_syncer/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ func TestLoadRegion(t *testing.T) {
for i := 0; i < 30; i++ {
rs.SaveRegion(&metapb.Region{Id: uint64(i) + 1})
}
re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/storage/base_backend/slowLoadRegion", "return(true)"))
re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/storage/endpoint/slowLoadRegion", "return(true)"))
defer func() {
re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/storage/base_backend/slowLoadRegion"))
re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/storage/endpoint/slowLoadRegion"))
}()

rc := NewRegionSyncer(server)
Expand Down
4 changes: 2 additions & 2 deletions tests/integrations/tso/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ func (suite *tsoClientTestSuite) TestUpdateAfterResetTSO() {
func (suite *tsoClientTestSuite) TestRandomResignLeader() {
re := suite.Require()
re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/tso/fastUpdatePhysicalInterval", "return(true)"))
defer re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/tso/fastUpdatePhysicalInterval"))

parallelAct := func() {
// After https://github.com/tikv/pd/issues/6376 is fixed, we can use a smaller number here.
Expand Down Expand Up @@ -358,12 +357,12 @@ func (suite *tsoClientTestSuite) TestRandomResignLeader() {
}

mcs.CheckMultiKeyspacesTSO(suite.ctx, re, suite.clients, parallelAct)
re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/tso/fastUpdatePhysicalInterval"))
}

func (suite *tsoClientTestSuite) TestRandomShutdown() {
re := suite.Require()
re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/tso/fastUpdatePhysicalInterval", "return(true)"))
defer re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/tso/fastUpdatePhysicalInterval"))

parallelAct := func() {
// After https://github.com/tikv/pd/issues/6376 is fixed, we can use a smaller number here.
Expand All @@ -382,6 +381,7 @@ func (suite *tsoClientTestSuite) TestRandomShutdown() {
mcs.CheckMultiKeyspacesTSO(suite.ctx, re, suite.clients, parallelAct)
suite.TearDownSuite()
suite.SetupSuite()
re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/tso/fastUpdatePhysicalInterval"))
}

// When we upgrade the PD cluster, there may be a period of time that the old and new PDs are running at the same time.
Expand Down