summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2017-05-14 11:34:00 +0200
committerJan Lehnardt <jan@apache.org>2017-05-16 09:37:32 +0200
commit51a630bd94aab693050c41defc320074d9dfc591 (patch)
treebef80f41200c7d22e8493d9f2e90bd29be37a63d
parentd583a463704baaa497f0d1d15917a3a0a3ed4c4c (diff)
downloadcouchdb-51a630bd94aab693050c41defc320074d9dfc591.tar.gz
chore: add debugging for failing test case, see COUCHDB-3415
-rw-r--r--src/chttpd/test/chttpd_db_test.erl12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/chttpd/test/chttpd_db_test.erl b/src/chttpd/test/chttpd_db_test.erl
index b7ea7f006..02d74ad94 100644
--- a/src/chttpd/test/chttpd_db_test.erl
+++ b/src/chttpd/test/chttpd_db_test.erl
@@ -86,7 +86,17 @@ should_accept_live_as_an_alias_for_continuous(Url) ->
?_test(begin
{ok, _, _, ResultBody} =
test_request:get(Url ++ "/_changes?feed=live&timeout=1", [?AUTH]),
- {ResultJson} = ?JSON_DECODE(ResultBody),
+ % https://issues.apache.org/jira/browse/COUCHDB-3415?filter=12340503
+ % if the decode fails, print out ResultBody, so we can debug what
+ % extra data is coming in.
+ {ResultJson} = try ?JSON_DECODE(ResultBody) of
+ Json -> Json
+ catch
+ throw:Error ->
+ io:format(user, "~nJSON_DECODE error: ~p~n", [Error]),
+ io:format(user, "~nOffending String: ~p~n", [ResultBody]),
+ ?assert(false) % should not happen, abort
+ end,
<<LastSeqNum0:1/binary, "-", _/binary>> = couch_util:get_value(
<<"last_seq">>, ResultJson, undefined),
LastSeqNum = list_to_integer(binary_to_list(LastSeqNum0)),