From 1ccd631753ca05cda04f51a11e7ffbdcf53f9f37 Mon Sep 17 00:00:00 2001 From: Nick Vatamaniuc Date: Wed, 7 Aug 2019 01:52:47 -0400 Subject: Fix cpse_test_purge_replication eunit test It doesn't work on Jenkins but worked locally. Noticed that we started chttpd even though the clustered port was never used. Add a wait function in `db_url/1` to make sure to wait until the db is available via the HTTP interface before continuing. --- src/couch_pse_tests/src/cpse_test_purge_replication.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/couch_pse_tests/src/cpse_test_purge_replication.erl b/src/couch_pse_tests/src/cpse_test_purge_replication.erl index 4a0822525..20dcc2f81 100644 --- a/src/couch_pse_tests/src/cpse_test_purge_replication.erl +++ b/src/couch_pse_tests/src/cpse_test_purge_replication.erl @@ -21,7 +21,7 @@ setup_all() -> - cpse_util:setup_all([mem3, fabric, chttpd, couch_replicator]). + cpse_util:setup_all([mem3, fabric, couch_replicator]). setup_each() -> @@ -205,4 +205,11 @@ make_shard(DbName) -> db_url(DbName) -> Addr = config:get("httpd", "bind_address", "127.0.0.1"), Port = mochiweb_socket_server:get(couch_httpd, port), - ?l2b(io_lib:format("http://~s:~b/~s", [Addr, Port, DbName])). + Url = ?l2b(io_lib:format("http://~s:~b/~s", [Addr, Port, DbName])), + test_util:wait(fun() -> + case test_request:get(?b2l(Url)) of + {ok, 200, _, _} -> ok; + _ -> wait + end + end), + Url. -- cgit v1.2.1