From 69886b1b9a9ff4cece94d1d6c4a05f05bda2062c Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Tue, 3 Dec 2024 16:22:04 +0800 Subject: [PATCH] fix Signed-off-by: Ryan Leung --- pkg/mcs/scheduling/server/server.go | 2 +- tests/integrations/mcs/scheduling/server_test.go | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/mcs/scheduling/server/server.go b/pkg/mcs/scheduling/server/server.go index f615a78fe05..39a65e995df 100644 --- a/pkg/mcs/scheduling/server/server.go +++ b/pkg/mcs/scheduling/server/server.go @@ -220,7 +220,7 @@ func (s *Server) updateAPIServerMemberLoop() { } if s.cluster.SwitchAPIServerLeader(pdpb.NewPDClient(cc)) { if status.Leader != curLeader { - log.Info("switch leader", zap.String("leader-id", fmt.Sprintf("%x", ep.ID)), zap.String("endpoint", ep.ClientURLs[0])) + log.Info("switch leader", zap.String("current-leader", fmt.Sprintf("%x", curLeader)), zap.String("new-leader-id", fmt.Sprintf("%x", ep.ID)), zap.String("endpoint", ep.ClientURLs[0])) } curLeader = ep.ID break diff --git a/tests/integrations/mcs/scheduling/server_test.go b/tests/integrations/mcs/scheduling/server_test.go index 76122a4f76c..5f64143d08b 100644 --- a/tests/integrations/mcs/scheduling/server_test.go +++ b/tests/integrations/mcs/scheduling/server_test.go @@ -500,7 +500,6 @@ func (suite *serverTestSuite) TestStoreLimit() { defer tc.Destroy() leaderServer := suite.pdLeader.GetServer() tc.WaitForPrimaryServing(re) - waitSwitchFinish(re, leaderServer, constant.SchedulingServiceName) oc := tc.GetPrimaryServer().GetCluster().GetCoordinator().GetOperatorController() conf := leaderServer.GetReplicationConfig().Clone() @@ -613,12 +612,6 @@ func waitSyncFinish(re *require.Assertions, tc *tests.TestSchedulingCluster, typ }) } -func waitSwitchFinish(re *require.Assertions, server *server.Server, serviceName string) { - testutil.Eventually(re, func() bool { - return server.IsServiceIndependent(serviceName) - }) -} - type multipleServerTestSuite struct { suite.Suite ctx context.Context