fix(TestV1Watch): ensure server has started

This commit is contained in:
Yicheng Qin
2014-05-09 15:42:18 -07:00
parent f1c13e2d9d
commit 6a64141962

View File

@@ -85,6 +85,13 @@ func TestV1GetKeyDir(t *testing.T) {
// //
func TestV1WatchKey(t *testing.T) { func TestV1WatchKey(t *testing.T) {
tests.RunServer(func(s *server.Server) { tests.RunServer(func(s *server.Server) {
// There exists a little gap between etcd ready to serve and
// it actually serves the first request, which means the response
// delay could be a little bigger.
// This test is time sensitive, so it does one request to ensure
// that the server is working.
tests.Get(fmt.Sprintf("%s%s", s.URL(), "/v1/keys/foo/bar"))
var watchResp *http.Response var watchResp *http.Response
c := make(chan bool) c := make(chan bool)
go func() { go func() {