This is an automated email from the ASF dual-hosted git repository. kocolosk pushed a commit to branch jenkins-cpse-debugging in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit f5778627c6abb147ea2957020c8ddb8889404f47 Author: Adam Kocoloski <[email protected]> AuthorDate: Fri Aug 9 16:34:43 2019 -0400 Liberally sprinkle debugging statements --- src/couch_pse_tests/src/cpse_test_purge_replication.erl | 17 +++++++++++++++-- 1 file changed, 15 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 20dcc2f..1489946 100644 --- a/src/couch_pse_tests/src/cpse_test_purge_replication.erl +++ b/src/couch_pse_tests/src/cpse_test_purge_replication.erl @@ -36,8 +36,10 @@ teardown_each({SrcDb, TgtDb}) -> cpse_purge_http_replication({Source, Target}) -> + ?debugHere, {ok, Rev1} = cpse_util:save_doc(Source, {[{'_id', foo}, {vsn, 1}]}), + ?debugHere, cpse_util:assert_db_props(?MODULE, ?LINE, Source, [ {doc_count, 1}, {del_doc_count, 0}, @@ -47,13 +49,16 @@ cpse_purge_http_replication({Source, Target}) -> {purge_infos, []} ]), + ?debugHere, RepObject = {[ {<<"source">>, db_url(Source)}, {<<"target">>, db_url(Target)} ]}, + ?debugVal(RepObject), {ok, _} = couch_replicator:replicate(RepObject, ?ADMIN_USER), {ok, Doc1} = cpse_util:open_doc(Target, foo), + ?debugHere, cpse_util:assert_db_props(?MODULE, ?LINE, Target, [ {doc_count, 1}, @@ -68,6 +73,7 @@ cpse_purge_http_replication({Source, Target}) -> {cpse_util:uuid(), <<"foo">>, [Rev1]} ], + ?debugMsg("starting purge"), {ok, [{ok, PRevs}]} = cpse_util:purge(Source, PurgeInfos), ?assertEqual([Rev1], PRevs), @@ -82,6 +88,7 @@ cpse_purge_http_replication({Source, Target}) -> % Show that a purge on the source is % not replicated to the target + ?debugMsg("starting second replication"), {ok, _} = couch_replicator:replicate(RepObject, ?ADMIN_USER), {ok, Doc2} = cpse_util:open_doc(Target, foo), [Rev2] = Doc2#doc_info.revs, @@ -104,6 +111,7 @@ cpse_purge_http_replication({Source, Target}) -> {<<"target">>, db_url(Source)} ]}, + ?debugMsg("starting third replication"), {ok, _} = couch_replicator:replicate(RepObject2, ?ADMIN_USER), {ok, Doc3} = cpse_util:open_doc(Source, foo), [Revs3] = Doc3#doc_info.revs, @@ -207,9 +215,14 @@ db_url(DbName) -> Port = mochiweb_socket_server:get(couch_httpd, port), Url = ?l2b(io_lib:format("http://~s:~b/~s", [Addr, Port, DbName])), test_util:wait(fun() -> + ?debugFmt("Trying to get ~s~n", [Url]), case test_request:get(?b2l(Url)) of - {ok, 200, _, _} -> ok; - _ -> wait + {ok, 200, _, _} -> + ?debugMsg("ok",) + ok; + Else -> + ?debugFmt("Failed with ~p~n", [Else]), + wait end end), Url.
