diff options
author | Nick Vatamaniuc <vatamane@apache.org> | 2019-08-07 01:52:47 -0400 |
---|---|---|
committer | Nick Vatamaniuc <nickva@users.noreply.github.com> | 2019-08-07 14:20:55 -0400 |
commit | 98a702c4a8784e3037f40f8d201fe0387a836428 (patch) | |
tree | 942d18bf6787e6bbd63d377ef56c638ce07b8c9f | |
parent | d5ae1bf416a6b2a06575c3a1e7206261d857d345 (diff) | |
download | couchdb-98a702c4a8784e3037f40f8d201fe0387a836428.tar.gz |
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.
-rw-r--r-- | src/couch_pse_tests/src/cpse_test_purge_replication.erl | 11 |
1 files 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. |