From 2101ccfed84c1790beed4bfe5447b0c3808f0da6 Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Sun, 7 Apr 2024 16:53:07 +0800 Subject: [PATCH] fix TestConfigTTL Signed-off-by: Ryan Leung --- tests/server/config/config_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/server/config/config_test.go b/tests/server/config/config_test.go index 1bc035cceca..86d4569f417 100644 --- a/tests/server/config/config_test.go +++ b/tests/server/config/config_test.go @@ -26,6 +26,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + cfg "github.com/tikv/pd/pkg/mcs/scheduling/server/config" "github.com/tikv/pd/pkg/ratelimit" sc "github.com/tikv/pd/pkg/schedule/config" tu "github.com/tikv/pd/pkg/utils/testutil" @@ -470,9 +471,10 @@ func (suite *configTestSuite) assertTTLConfig( } checkFunc(cluster.GetLeaderServer().GetServer().GetPersistOptions()) if cluster.GetSchedulingPrimaryServer() != nil { - // wait for the scheduling primary server to be synced - options := cluster.GetSchedulingPrimaryServer().GetPersistConfig() + var options *cfg.PersistConfig tu.Eventually(re, func() bool { + // wait for the scheduling primary server to be synced + options = cluster.GetSchedulingPrimaryServer().GetPersistConfig() if expectedEqual { return uint64(999) == options.GetMaxSnapshotCount() }