From c3f04111284c0f38bc5c24fd5c44b6a4745f2f6e Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Wed, 4 Dec 2024 18:40:31 +0800 Subject: [PATCH] debug Signed-off-by: Ryan Leung --- tests/integrations/mcs/scheduling/server_test.go | 3 +++ tests/scheduling_cluster.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/integrations/mcs/scheduling/server_test.go b/tests/integrations/mcs/scheduling/server_test.go index cb036e8b042..fc07436b92f 100644 --- a/tests/integrations/mcs/scheduling/server_test.go +++ b/tests/integrations/mcs/scheduling/server_test.go @@ -500,6 +500,9 @@ func (suite *serverTestSuite) TestStoreLimit() { defer tc.Destroy() leaderServer := suite.pdLeader.GetServer() tc.WaitForPrimaryServing(re) + testutil.Eventually(re, func() bool { + return leaderServer.GetRaftCluster().IsServiceIndependent(constant.SchedulingServiceName) + }) oc := tc.GetPrimaryServer().GetCluster().GetCoordinator().GetOperatorController() conf := leaderServer.GetReplicationConfig().Clone() diff --git a/tests/scheduling_cluster.go b/tests/scheduling_cluster.go index 3f7c39eb81c..23a59d564b8 100644 --- a/tests/scheduling_cluster.go +++ b/tests/scheduling_cluster.go @@ -107,7 +107,7 @@ func (tc *TestSchedulingCluster) WaitForPrimaryServing(re *require.Assertions) * var primary *scheduling.Server testutil.Eventually(re, func() bool { for _, server := range tc.servers { - if server.IsServing() { + if server.IsServing() && server.GetCoordinator().AreSchedulersInitialized() { primary = server return true }