From 7ba16de0b68accc3a47840562f877aa71b3a2699 Mon Sep 17 00:00:00 2001 From: nolouch Date: Fri, 4 Jun 2021 18:56:59 +0800 Subject: [PATCH] fix test Signed-off-by: nolouch --- server/config/config.go | 8 ++++---- server/config/config_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/config/config.go b/server/config/config.go index 17dcb0b3d06..cf063ab8262 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -1077,8 +1077,8 @@ type PDServerConfig struct { MetricStorage string `toml:"metric-storage" json:"metric-storage"` // There are some values supported: "auto", "none", or a specific address, default: "auto" DashboardAddress string `toml:"dashboard-address" json:"dashboard-address"` - // TraceRegionFlow the option to update flow information of regions - // WARN: TraceRegionFlow is deprecate + // TraceRegionFlow the option to update flow information of regions. + // WARN: TraceRegionFlow is deprecated. TraceRegionFlow bool `toml:"trace-region-flow" json:"trace-region-flow,string,omitempty"` // FlowRoundByDigit used to discretization processing flow information. FlowRoundByDigit int `toml:"flow-round-by-digit" json:"flow-round-by-digit"` @@ -1118,7 +1118,7 @@ func (c *PDServerConfig) migrateConfigurationFromFile(meta *configMetaData) erro } case defineOld && !defineNew: if !c.TraceRegionFlow { - c.FlowRoundByDigit = math.MaxInt64 + c.FlowRoundByDigit = math.MaxInt8 } } return nil @@ -1127,7 +1127,7 @@ func (c *PDServerConfig) migrateConfigurationFromFile(meta *configMetaData) erro // MigrateDeprecatedFlags updates new flags according to deprecated flags. func (c *PDServerConfig) MigrateDeprecatedFlags() { if !c.TraceRegionFlow { - c.FlowRoundByDigit = math.MaxInt64 + c.FlowRoundByDigit = math.MaxInt8 } // json omity the false. next time will not persist to the kv. c.TraceRegionFlow = false diff --git a/server/config/config_test.go b/server/config/config_test.go index 41035f07293..2f36dcd244f 100644 --- a/server/config/config_test.go +++ b/server/config/config_test.go @@ -285,7 +285,7 @@ func (s *testConfigSuite) TestMigrateFlags(c *C) { return cfg, err } cfg, err := load(` -[server] +[pd-server] trace-region-flow = false [schedule] disable-remove-down-replica = true @@ -294,7 +294,7 @@ disable-remove-extra-replica = true enable-remove-extra-replica = false `) c.Assert(err, IsNil) - c.Assert(cfg.PDServerCfg.FlowRoundByDigit, Equals, math.MaxInt64) + c.Assert(cfg.PDServerCfg.FlowRoundByDigit, Equals, math.MaxInt8) c.Assert(cfg.Schedule.EnableReplaceOfflineReplica, IsTrue) c.Assert(cfg.Schedule.EnableRemoveDownReplica, IsFalse) c.Assert(cfg.Schedule.EnableMakeUpReplica, IsFalse)