From 6a6414196229de6ba7a0d10887bf87d338694c40 Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Fri, 9 May 2014 15:42:18 -0700 Subject: [PATCH] fix(TestV1Watch): ensure server has started --- server/v1/tests/get_handler_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/v1/tests/get_handler_test.go b/server/v1/tests/get_handler_test.go index 8e9c52ee5..dd80732d9 100644 --- a/server/v1/tests/get_handler_test.go +++ b/server/v1/tests/get_handler_test.go @@ -85,6 +85,13 @@ func TestV1GetKeyDir(t *testing.T) { // func TestV1WatchKey(t *testing.T) { 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 c := make(chan bool) go func() {