From 7a5ea348a1c0f34aac5afaa78125b853f4f453c4 Mon Sep 17 00:00:00 2001 From: bufferflies <1045931706@qq.com> Date: Mon, 23 Dec 2024 14:49:27 +0800 Subject: [PATCH 1/2] fix panic Signed-off-by: bufferflies <1045931706@qq.com> --- tests/integrations/mcs/scheduling/server_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/integrations/mcs/scheduling/server_test.go b/tests/integrations/mcs/scheduling/server_test.go index ea1e9df0b50..bc9d5c9dabf 100644 --- a/tests/integrations/mcs/scheduling/server_test.go +++ b/tests/integrations/mcs/scheduling/server_test.go @@ -106,7 +106,7 @@ func (suite *serverTestSuite) TestAllocIDAfterLeaderChange() { re := suite.Require() re.NoError(failpoint.Enable("github.com/tikv/pd/pkg/mcs/scheduling/server/fastUpdateMember", `return(true)`)) pd2, err := suite.cluster.Join(suite.ctx) - re.NoError(err) + re.NoError(err, "error: %v", err) err = pd2.Run() re.NotEmpty(suite.cluster.WaitLeader()) re.NoError(err) @@ -261,6 +261,12 @@ func (suite *serverTestSuite) TestDisableSchedulingServiceFallback() { // API server will execute scheduling jobs since there is no scheduling server. testutil.Eventually(re, func() bool { + if suite.pdLeader.GetServer() == nil { + println("server is nil") + } + if suite.pdLeader.GetServer().GetRaftCluster() == nil { + println("raft cluster is nil") + } return suite.pdLeader.GetServer().GetRaftCluster().IsSchedulingControllerRunning() }) leaderServer := suite.pdLeader.GetServer() From 062e9edba2afc2d008b07393d45e2070bcbf35e9 Mon Sep 17 00:00:00 2001 From: bufferflies <1045931706@qq.com> Date: Tue, 24 Dec 2024 15:10:18 +0800 Subject: [PATCH 2/2] add error log Signed-off-by: bufferflies <1045931706@qq.com> --- tests/integrations/mcs/scheduling/server_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tests/integrations/mcs/scheduling/server_test.go b/tests/integrations/mcs/scheduling/server_test.go index bc9d5c9dabf..3401fb880cb 100644 --- a/tests/integrations/mcs/scheduling/server_test.go +++ b/tests/integrations/mcs/scheduling/server_test.go @@ -261,12 +261,8 @@ func (suite *serverTestSuite) TestDisableSchedulingServiceFallback() { // API server will execute scheduling jobs since there is no scheduling server. testutil.Eventually(re, func() bool { - if suite.pdLeader.GetServer() == nil { - println("server is nil") - } - if suite.pdLeader.GetServer().GetRaftCluster() == nil { - println("raft cluster is nil") - } + re.NotNil(suite.pdLeader.GetServer()) + re.NotNil(suite.pdLeader.GetServer().GetRaftCluster()) return suite.pdLeader.GetServer().GetRaftCluster().IsSchedulingControllerRunning() }) leaderServer := suite.pdLeader.GetServer()