diff --git a/tests/integrations/client/client_test.go b/tests/integrations/client/client_test.go index 9cabbb03090..3834d9b53bf 100644 --- a/tests/integrations/client/client_test.go +++ b/tests/integrations/client/client_test.go @@ -158,6 +158,10 @@ func TestLeaderTransfer(t *testing.T) { cluster, err := tests.NewTestCluster(ctx, 2) re.NoError(err) defer cluster.Destroy() + re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck", "return(true)")) + defer func() { + re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck")) + }() endpoints := runServer(re, cluster) cli := setupCli(re, ctx, endpoints) diff --git a/tests/integrations/mcs/resourcemanager/resource_manager_test.go b/tests/integrations/mcs/resourcemanager/resource_manager_test.go index 91a21caf91b..b98686222fe 100644 --- a/tests/integrations/mcs/resourcemanager/resource_manager_test.go +++ b/tests/integrations/mcs/resourcemanager/resource_manager_test.go @@ -63,6 +63,7 @@ func (suite *resourceManagerClientTestSuite) SetupSuite() { re := suite.Require() re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/resourcemanager/server/enableDegradedMode", `return(true)`)) + re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck", "return(true)")) suite.ctx, suite.clean = context.WithCancel(context.Background()) @@ -148,6 +149,7 @@ func (suite *resourceManagerClientTestSuite) TearDownSuite() { suite.cluster.Destroy() suite.clean() re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/mcs/resourcemanager/server/enableDegradedMode")) + re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck")) } func (suite *resourceManagerClientTestSuite) TearDownTest() { diff --git a/tests/integrations/mcs/tso/server_test.go b/tests/integrations/mcs/tso/server_test.go index 643fb3c7911..c81c39af094 100644 --- a/tests/integrations/mcs/tso/server_test.go +++ b/tests/integrations/mcs/tso/server_test.go @@ -392,6 +392,11 @@ func (suite *APIServerForwardTestSuite) TestResignAPIPrimaryForward() { defer tc.Destroy() tc.WaitForDefaultPrimaryServing(re) + re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck", "return(true)")) + defer func() { + re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck")) + }() + for j := 0; j < 10; j++ { suite.pdLeader.ResignLeader() suite.pdLeader = suite.cluster.GetServer(suite.cluster.WaitLeader()) diff --git a/tests/integrations/tso/client_test.go b/tests/integrations/tso/client_test.go index 73198690966..8ff20d68f52 100644 --- a/tests/integrations/tso/client_test.go +++ b/tests/integrations/tso/client_test.go @@ -339,6 +339,11 @@ func (suite *tsoClientTestSuite) TestUpdateAfterResetTSO() { func (suite *tsoClientTestSuite) TestRandomResignLeader() { re := suite.Require() re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/tso/fastUpdatePhysicalInterval", "return(true)")) + re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck", "return(true)")) + defer func() { + re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/tso/fastUpdatePhysicalInterval")) + re.NoError(failpoint.Disable("github.com/tikv/pd/pkg/member/skipCampaignLeaderCheck")) + }() parallelAct := func() { // After https://github.com/tikv/pd/issues/6376 is fixed, we can use a smaller number here. @@ -376,7 +381,6 @@ 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() {