Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <disxiaofei@163.com>
  • Loading branch information
Yisaer committed Nov 25, 2021
1 parent 75d363a commit d453b24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ type Performance struct {
CommitterConcurrency int `toml:"committer-concurrency" json:"committer-concurrency"`
MaxTxnTTL uint64 `toml:"max-txn-ttl" json:"max-txn-ttl"`
// Deprecated
MemProfileInterval string `toml:"mem-profile-interval" json:"mem-profile-interval"`
MemProfileInterval string `toml:"-" json:"-"`
IndexUsageSyncLease string `toml:"index-usage-sync-lease" json:"index-usage-sync-lease"`
PlanReplayerGCLease string `toml:"plan-replayer-gc-lease" json:"plan-replayer-gc-lease"`
GOGC int `toml:"gogc" json:"gogc"`
Expand Down
9 changes: 8 additions & 1 deletion config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,16 @@ receiver-address = "127.0.0.1:10100"
require.Equal(t, "127.0.0.1:10100", conf.TopSQL.ReceiverAddress)
require.True(t, conf.Experimental.AllowsExpressionIndex)

err = f.Truncate(0)
require.NoError(t, err)
_, err = f.Seek(0, 0)
require.NoError(t, err)
require.NoError(t, f.Sync())
_, err = f.WriteString(`
[log.file]
log-rotate = true`)
log-rotate = true
[performance]
mem-profile-interval="1m"`)
require.NoError(t, err)
err = conf.Load(configFile)
tmp := err.(*ErrConfigValidationFailed)
Expand Down

0 comments on commit d453b24

Please sign in to comment.