You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by pg...@apache.org on 2024/03/15 19:25:15 UTC

(couchdb) branch jenkins-test-couch_replicator_error created (now ff6148a53)

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

pgj pushed a change to branch jenkins-test-couch_replicator_error
in repository https://gitbox.apache.org/repos/asf/couchdb.git


      at ff6148a53 couch_replicator: fix reporting for unexpected test responses

This branch includes the following new commits:

     new ff6148a53 couch_replicator: fix reporting for unexpected test responses

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(couchdb) 01/01: couch_replicator: fix reporting for unexpected test responses

Posted by pg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ff6148a53269902d12a5683f6f8dae148ac07737
Author: Gabor Pali <ga...@ibm.com>
AuthorDate: Fri Mar 15 20:06:17 2024 +0100

    couch_replicator: fix reporting for unexpected test responses
    
    The freshly introduced debugging statements for tracing the run
    of the `couch_replicator` scheduler docs tests fail to provide
    information on unknown errors (possibly crashes) which are coming
    with a stack trace.  Enhance the related case distinction to
    handle these cases.  At the same time, rewrite the assertion on
    the expected result to make it more specific with regard to the
    contents of the document.
---
 .../test/eunit/couch_replicator_scheduler_docs_tests.erl             | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/couch_replicator/test/eunit/couch_replicator_scheduler_docs_tests.erl b/src/couch_replicator/test/eunit/couch_replicator_scheduler_docs_tests.erl
index e04518b67..f80b891c2 100644
--- a/src/couch_replicator/test/eunit/couch_replicator_scheduler_docs_tests.erl
+++ b/src/couch_replicator/test/eunit/couch_replicator_scheduler_docs_tests.erl
@@ -133,6 +133,9 @@ t_scheduler_docs_total_rows({_Ctx, {RepDb, Source, Target}}) ->
             case req(get, SchedulerDocsUrl) of
                 {200, #{<<"docs">> := [_ | _]} = Decoded} ->
                     Decoded;
+                {_, #{<<"error">> := (<<"unknown_error">> = Error), <<"reason">> := StackTrace}} ->
+                    ?debugVal(Error),
+                    ?debugVal(StackTrace, 100);
                 {_, #{<<"error">> := Error, <<"reason">> := Reason}} ->
                     ?debugVal(Error, 100),
                     ?debugVal(binary_to_list(Reason), 100);
@@ -143,7 +146,7 @@ t_scheduler_docs_total_rows({_Ctx, {RepDb, Source, Target}}) ->
         14000,
         1000
     ),
-    ?assertNotEqual(Body, timeout),
+    ?assertMatch(#{<<"docs">> := _, <<"total_rows">> := _}, Body),
     Docs = maps:get(<<"docs">>, Body),
     TotalRows = maps:get(<<"total_rows">>, Body),
     ?assertEqual(TotalRows, length(Docs)).