diff --git a/tests/integrations/mcs/tso/keyspace_group_manager_test.go b/tests/integrations/mcs/tso/keyspace_group_manager_test.go index af33b85b1a1..f678e901419 100644 --- a/tests/integrations/mcs/tso/keyspace_group_manager_test.go +++ b/tests/integrations/mcs/tso/keyspace_group_manager_test.go @@ -793,9 +793,11 @@ func (suite *tsoKeyspaceGroupManagerTestSuite) TestKeyspaceGroupMergeIntoDefault // Check if the first keyspace group is served. svr := suite.tsoCluster.WaitForDefaultPrimaryServing(re) re.NotNil(svr) - // Check if the last keyspace group is served. - svr = suite.tsoCluster.WaitForPrimaryServing(re, uint32(keyspaceGroupNum), uint32(keyspaceGroupNum)) - re.NotNil(svr) + for i := 1; i < keyspaceGroupNum; i++ { + // Check if the keyspace group is served. + svr = suite.tsoCluster.WaitForPrimaryServing(re, uint32(i), uint32(i)) + re.NotNil(svr) + } // Merge all the keyspace groups into the default keyspace group. handlersutil.MustMergeKeyspaceGroup(re, suite.pdLeaderServer, mcsutils.DefaultKeyspaceGroupID, &handlers.MergeKeyspaceGroupsParams{ MergeAllIntoDefault: true,