mirror of
https://github.com/valitydev/riak_test.git
synced 2024-11-06 16:45:29 +00:00
Update test for 503 error response
This commit is contained in:
parent
016ab533d1
commit
1c790063dc
@ -218,7 +218,9 @@ http_stream_loop(Ref, Acc, {Boundary, BLen}=B) ->
|
||||
Result),
|
||||
http_stream_loop(Ref, Acc2, B);
|
||||
{http, {Ref, stream, <<"\r\n--", Boundary:BLen/bytes, "--\r\n">>}} ->
|
||||
http_stream_loop(Ref, Acc, B)
|
||||
http_stream_loop(Ref, Acc, B);
|
||||
Other -> lager:error("Unexpected message ~p", [Other]),
|
||||
{error, unknown_message}
|
||||
after 60000 ->
|
||||
{error, timeout_local}
|
||||
end.
|
||||
|
@ -47,9 +47,10 @@ confirm() ->
|
||||
{ok, Res} = stream_pb(PBPid, Query, [{timeout, 5000}]),
|
||||
?assertEqual(ExpectedKeys, proplists:get_value(keys, Res, [])),
|
||||
|
||||
{ok, {{_, 500, _}, _, Body}} = httpc:request(url("~s/buckets/~s/index/~s/~s~s",
|
||||
{ok, {{_, 503, _}, _, Body}} = httpc:request(url("~s/buckets/~s/index/~s/~s~s",
|
||||
[Http, ?BUCKET, <<"$bucket">>, ?BUCKET, []])),
|
||||
?assertMatch({match, _}, re:run(Body, "{error,timeout}")), %% shows the app.config timeout
|
||||
|
||||
?assertMatch({match, _}, re:run(Body, "request timed out")), %% shows the app.config timeout
|
||||
|
||||
HttpRes = http_query(Http, Query, [{timeout, 5000}]),
|
||||
?assertEqual(ExpectedKeys, proplists:get_value(<<"keys">>, HttpRes, [])),
|
||||
|
Loading…
Reference in New Issue
Block a user