summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Vatamaniuc <vatamane@apache.org>2019-08-07 01:52:47 -0400
committerNick Vatamaniuc <vatamane@apache.org>2019-08-07 01:57:46 -0400
commit1ccd631753ca05cda04f51a11e7ffbdcf53f9f37 (patch)
tree942d18bf6787e6bbd63d377ef56c638ce07b8c9f
parentd5ae1bf416a6b2a06575c3a1e7206261d857d345 (diff)
downloadcouchdb-jenkins-fix-cpse-repl-purge-test.tar.gz
Fix cpse_test_purge_replication eunit testjenkins-fix-cpse-repl-purge-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.erl11
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.