Refactor testServerDC
This commit is contained in:
parent
6b45c2c5a4
commit
d741a999f5
|
@ -30,9 +30,13 @@ func testServer(t *testing.T) (string, *Server) {
|
|||
}
|
||||
|
||||
func testServerDC(t *testing.T, dc string) (string, *Server) {
|
||||
return testServerDCBootstrap(t, "dc1", true)
|
||||
}
|
||||
|
||||
func testServerDCBootstrap(t *testing.T, dc string, bootstrap bool) (string, *Server) {
|
||||
dir := tmpDir(t)
|
||||
config := DefaultConfig()
|
||||
config.Bootstrap = true
|
||||
config.Bootstrap = bootstrap
|
||||
config.Datacenter = dc
|
||||
config.DataDir = dir
|
||||
|
||||
|
@ -60,6 +64,8 @@ func testServerDC(t *testing.T, dc string) (string, *Server) {
|
|||
config.RaftConfig.HeartbeatTimeout = 40 * time.Millisecond
|
||||
config.RaftConfig.ElectionTimeout = 40 * time.Millisecond
|
||||
|
||||
config.ReconcileInterval = 50 * time.Millisecond
|
||||
|
||||
server, err := NewServer(config)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %v", err)
|
||||
|
|
Loading…
Reference in New Issue