aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2012-01-06 20:49:31 +0100
committerLoïc Hoguin <[email protected]>2012-01-06 20:49:31 +0100
commitd2f13366a9663a7facac7ad6d621d5131e778e28 (patch)
tree9583872d34e0874014c2a59546834ff044e3cab7
parentfd211d3c039e3521537087ef848727bb4f7410c0 (diff)
downloadcowboy-d2f13366a9663a7facac7ad6d621d5131e778e28.tar.gz
cowboy-d2f13366a9663a7facac7ad6d621d5131e778e28.tar.bz2
cowboy-d2f13366a9663a7facac7ad6d621d5131e778e28.zip
Fix the stream_body_set_resp test
It was failing from time to time due to the response being sent as two separate packets.
-rw-r--r--test/http_SUITE.erl11
1 files changed, 4 insertions, 7 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 76234ed..0deda51 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -408,13 +408,10 @@ The document has moved
{Packet, 400} = raw_req(Packet, Config).
stream_body_set_resp(Config) ->
- {port, Port} = lists:keyfind(port, 1, Config),
- {ok, Socket} = gen_tcp:connect("localhost", Port,
- [binary, {active, false}, {packet, raw}]),
- ok = gen_tcp:send(Socket, "GET /stream_body/set_resp HTTP/1.1\r\n"
- "Host: localhost\r\nConnection: close\r\n\r\n"),
- {ok, Data} = gen_tcp:recv(Socket, 0, 6000),
- {_Start, _Length} = binary:match(Data, <<"stream_body_set_resp">>).
+ {Packet, 200} = raw_resp(
+ "GET /stream_body/set_resp HTTP/1.1\r\n"
+ "Host: localhost\r\nConnection: close\r\n\r\n", Config),
+ {_Start, _Length} = binary:match(Packet, <<"stream_body_set_resp">>).
static_mimetypes_function(Config) ->
TestURL = build_url("/static_mimetypes_function/test.html", Config),