diff --git a/server/embed/config.go b/server/embed/config.go index 3a3820568342..275f63324b84 100644 --- a/server/embed/config.go +++ b/server/embed/config.go @@ -615,6 +615,14 @@ func NewConfig() *Config { } func (cfg *Config) AddFlags(fs *flag.FlagSet) { + cfg.AddFlagsWithoutGlobals(fs) + + // raft connection timeouts + fs.DurationVar(&rafthttp.ConnReadTimeout, "raft-read-timeout", rafthttp.DefaultConnReadTimeout, "Read timeout set on each rafthttp connection") + fs.DurationVar(&rafthttp.ConnWriteTimeout, "raft-write-timeout", rafthttp.DefaultConnWriteTimeout, "Write timeout set on each rafthttp connection") +} + +func (cfg *Config) AddFlagsWithoutGlobals(fs *flag.FlagSet) { // member fs.StringVar(&cfg.Dir, "data-dir", cfg.Dir, "Path to the data directory.") fs.StringVar(&cfg.WalDir, "wal-dir", cfg.WalDir, "Path to the dedicated wal directory.") @@ -657,10 +665,6 @@ func (cfg *Config) AddFlags(fs *flag.FlagSet) { fs.Var(flags.NewUint32Value(cfg.MaxConcurrentStreams), "max-concurrent-streams", "Maximum concurrent streams that each client can open at a time.") - // raft connection timeouts - fs.DurationVar(&rafthttp.ConnReadTimeout, "raft-read-timeout", rafthttp.DefaultConnReadTimeout, "Read timeout set on each rafthttp connection") - fs.DurationVar(&rafthttp.ConnWriteTimeout, "raft-write-timeout", rafthttp.DefaultConnWriteTimeout, "Write timeout set on each rafthttp connection") - // clustering fs.Var( flags.NewUniqueURLsWithExceptions(DefaultInitialAdvertisePeerURLs, ""), diff --git a/tests/framework/e2e/cluster.go b/tests/framework/e2e/cluster.go index 46ff29a7e195..357375d06487 100644 --- a/tests/framework/e2e/cluster.go +++ b/tests/framework/e2e/cluster.go @@ -679,7 +679,7 @@ func (cfg *EtcdProcessClusterConfig) EtcdServerProcessConfig(tb testing.TB, i in func values(cfg embed.Config) map[string]string { fs := flag.NewFlagSet("etcd", flag.ContinueOnError) - cfg.AddFlags(fs) + cfg.AddFlagsWithoutGlobals(fs) values := map[string]string{} fs.VisitAll(func(f *flag.Flag) { value := f.Value.String()