aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Fish <[email protected]>2013-04-26 00:46:15 +0100
committerJames Fish <[email protected]>2013-04-26 02:08:50 +0100
commit77d10822332a782266e1adf58fcb5cfc24cd84b7 (patch)
tree7cb87ccf25a2e6b4456312b11f778ec740c38daf
parent61b3157ad14ae49da3ac6b33643a876eb18bbf2a (diff)
downloadcowboy-77d10822332a782266e1adf58fcb5cfc24cd84b7.tar.gz
cowboy-77d10822332a782266e1adf58fcb5cfc24cd84b7.tar.bz2
cowboy-77d10822332a782266e1adf58fcb5cfc24cd84b7.zip
Fix memory issue with large return values in testcases
Previously http_SUITE:echo_body/1 and http_SUITE:check_raw_status/1 returned large values. Common test would then try to write these to the logs causing tests to take a long time and use lots of memory.
-rw-r--r--test/http_SUITE.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 5cc63f1..f436dd9 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -496,7 +496,8 @@ The document has moved
_ = [{Status, Packet} = begin
Ret = quick_raw(Packet, Config),
{Ret, Packet}
- end || {Status, Packet} <- Tests].
+ end || {Status, Packet} <- Tests],
+ ok.
check_status(Config) ->
Tests = [
@@ -536,7 +537,7 @@ chunked_response(Config) ->
echo_body(Config) ->
Client = ?config(client, Config),
{ok, [{mtu, MTU}]} = inet:ifget("lo", [mtu]),
- [begin
+ _ = [begin
Body = list_to_binary(lists:duplicate(Size, $a)),
{ok, Client2} = cowboy_client:request(<<"POST">>,
build_url("/echo/body", Config),
@@ -544,7 +545,8 @@ echo_body(Config) ->
Body, Client),
{ok, 200, _, Client3} = cowboy_client:response(Client2),
{ok, Body, _} = cowboy_client:response_body(Client3)
- end || Size <- lists:seq(MTU - 500, MTU)].
+ end || Size <- lists:seq(MTU - 500, MTU)],
+ ok.
%% Check if sending request whose size is bigger than 1000000 bytes causes 413
echo_body_max_length(Config) ->