Refactor testServerDC

This commit is contained in:
Armon Dadgar 2014-01-10 11:07:29 -08:00
parent 6b45c2c5a4
commit d741a999f5
1 changed files with 7 additions and 1 deletions

View File

@ -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)