mirror of
https://github.com/status-im/consul.git
synced 2025-01-22 11:40:06 +00:00
Refactor testServerDC
This commit is contained in:
parent
4b33ff20d0
commit
992db5d291
@ -30,9 +30,13 @@ func testServer(t *testing.T) (string, *Server) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func testServerDC(t *testing.T, dc string) (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)
|
dir := tmpDir(t)
|
||||||
config := DefaultConfig()
|
config := DefaultConfig()
|
||||||
config.Bootstrap = true
|
config.Bootstrap = bootstrap
|
||||||
config.Datacenter = dc
|
config.Datacenter = dc
|
||||||
config.DataDir = dir
|
config.DataDir = dir
|
||||||
|
|
||||||
@ -60,6 +64,8 @@ func testServerDC(t *testing.T, dc string) (string, *Server) {
|
|||||||
config.RaftConfig.HeartbeatTimeout = 40 * time.Millisecond
|
config.RaftConfig.HeartbeatTimeout = 40 * time.Millisecond
|
||||||
config.RaftConfig.ElectionTimeout = 40 * time.Millisecond
|
config.RaftConfig.ElectionTimeout = 40 * time.Millisecond
|
||||||
|
|
||||||
|
config.ReconcileInterval = 50 * time.Millisecond
|
||||||
|
|
||||||
server, err := NewServer(config)
|
server, err := NewServer(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("err: %v", err)
|
t.Fatalf("err: %v", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user