You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2020/02/12 08:24:06 UTC

[couchdb] 01/03: Fix failing test getting 500 expecting 503

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

jaydoane pushed a commit to branch test-improvements
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 155f70fbc3e146a1570dfee32219bb2b1e8bad0d
Author: Jay Doane <ja...@apache.org>
AuthorDate: Wed Feb 12 00:22:24 2020 -0800

    Fix failing test getting 500 expecting 503
    
    06-basic-text-test.py", line 27, in test_create_text_index
        assert resp.status_code == 503, resp
    AssertionError: <Response [500]>
---
 src/mango/src/mango_idx.erl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mango/src/mango_idx.erl b/src/mango/src/mango_idx.erl
index 501d8ef..a1bbe0a 100644
--- a/src/mango/src/mango_idx.erl
+++ b/src/mango/src/mango_idx.erl
@@ -372,7 +372,7 @@ get_idx_def(Opts) ->
 get_idx_type(Opts) ->
     case proplists:get_value(type, Opts) of
         <<"json">> -> <<"json">>;
-        <<"text">> -> case clouseau_rpc:connected() of
+        <<"text">> -> case is_text_service_available() of
             true ->
                 <<"text">>;
             false ->
@@ -385,6 +385,11 @@ get_idx_type(Opts) ->
     end.
 
 
+is_text_service_available() ->
+    erlang:function_exported(clouseau_rpc, connected, 0) andalso
+        clouseau_rpc:connected().
+
+
 get_idx_ddoc(Idx, Opts) ->
     case proplists:get_value(ddoc, Opts) of
         <<"_design/", _Rest/binary>> = Name ->