From c39f7712f740aee0f4af905e73699a17b5eab378 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Tue, 6 Aug 2013 23:28:59 -0700 Subject: [PATCH] fix test --- client_handlers.go | 12 ++++++------ etcd.go | 2 +- test.go | 3 +++ 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/client_handlers.go b/client_handlers.go index 7bf83be57..371934059 100644 --- a/client_handlers.go +++ b/client_handlers.go @@ -1,10 +1,10 @@ package main import ( + "fmt" "github.com/coreos/etcd/store" "net/http" "strconv" - "fmt" "time" ) @@ -72,9 +72,9 @@ func SetHttpHandler(w *http.ResponseWriter, req *http.Request) { if len(prevValue) != 0 { command := &TestAndSetCommand{ - Key: key, - Value: value, - PrevValue: prevValue, + Key: key, + Value: value, + PrevValue: prevValue, ExpireTime: expireTime, } @@ -82,8 +82,8 @@ func SetHttpHandler(w *http.ResponseWriter, req *http.Request) { } else { command := &SetCommand{ - Key: key, - Value: value, + Key: key, + Value: value, ExpireTime: expireTime, } diff --git a/etcd.go b/etcd.go index 605db53a1..a9eea5510 100644 --- a/etcd.go +++ b/etcd.go @@ -555,7 +555,7 @@ func getInfo(path string) *Info { info := &Info{ Hostname: hostname, - RaftPort: raftPort, + RaftPort: raftPort, ClientPort: clientPort, WebPort: webPort, diff --git a/test.go b/test.go index 02ce50c5a..db9bedb5a 100644 --- a/test.go +++ b/test.go @@ -74,6 +74,9 @@ func createCluster(size int, procAttr *os.ProcAttr) ([][]string, []*os.Process, if err != nil { return nil, nil, err } + // we only add machine one to the cluster list + // thus we need to make sure other node start after the first one has done set up + time.Sleep(time.Millisecond * 200) } return argGroup, etcds, nil