0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Reduce the pipeline test body sizes to avoid filling send buffers

This causes the test to get stuck because both the client and
server end up waiting in Transport:send for the other side to
read data from the socket.
This commit is contained in:
Loïc Hoguin 2020-04-05 16:28:54 +02:00
parent 4ab69f402e
commit cc8a2e4257
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764

View file

@ -1557,13 +1557,13 @@ pipeline(Config) ->
ConnPid = gun_open(Config), ConnPid = gun_open(Config),
Refs = [{ Refs = [{
gun:get(ConnPid, "/"), gun:get(ConnPid, "/"),
gun:post(ConnPid, "/full/read_body", [], <<0:800000>>) gun:post(ConnPid, "/full/read_body", [], <<0:80000>>)
} || _ <- lists:seq(1, 25)], } || _ <- lists:seq(1, 25)],
_ = [begin _ = [begin
{response, nofin, 200, _} = gun:await(ConnPid, Ref1, infinity), {response, nofin, 200, _} = gun:await(ConnPid, Ref1, infinity),
{ok, <<"Hello world!">>} = gun:await_body(ConnPid, Ref1, infinity), {ok, <<"Hello world!">>} = gun:await_body(ConnPid, Ref1, infinity),
{response, nofin, 200, _} = gun:await(ConnPid, Ref2, infinity), {response, nofin, 200, _} = gun:await(ConnPid, Ref2, infinity),
{ok, <<0:800000>>} = gun:await_body(ConnPid, Ref2, infinity) {ok, <<0:80000>>} = gun:await_body(ConnPid, Ref2, infinity)
end || {Ref1, Ref2} <- Refs], end || {Ref1, Ref2} <- Refs],
ok. ok.