You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2019/08/07 18:21:01 UTC

[couchdb] branch master updated: Fix cpse_test_purge_replication eunit test

This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 98a702c  Fix cpse_test_purge_replication eunit test
98a702c is described below

commit 98a702c4a8784e3037f40f8d201fe0387a836428
Author: Nick Vatamaniuc <va...@apache.org>
AuthorDate: Wed Aug 7 01:52:47 2019 -0400

    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 4a08225..20dcc2f 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.