From b3e66ee980bd200d25b7fe4b4068354bfb1d830e Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Thu, 8 May 2014 12:12:26 -0700 Subject: [PATCH] fix(TestV2Watch): ensure server has started --- server/v2/tests/get_handler_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/v2/tests/get_handler_test.go b/server/v2/tests/get_handler_test.go index 1c7825d07..4d04caeb5 100644 --- a/server/v2/tests/get_handler_test.go +++ b/server/v2/tests/get_handler_test.go @@ -90,6 +90,13 @@ func TestV2GetKeyRecursively(t *testing.T) { // func TestV2WatchKey(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(), "/v2/keys/foo/bar")) + var watchResp *http.Response c := make(chan bool) go func() {