aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-05-20 18:17:49 +0200
committerLoïc Hoguin <[email protected]>2018-05-20 18:17:49 +0200
commit6e00600d7d2bc54110678823c7ab396822826d4c (patch)
tree0f2de589bcc16a220f992ed23d2d4b6048a53112 /test
parent4e896fabd5f868d2b5281fe7dda77f9dcb7990fe (diff)
downloadcowboy-6e00600d7d2bc54110678823c7ab396822826d4c.tar.gz
cowboy-6e00600d7d2bc54110678823c7ab396822826d4c.tar.bz2
cowboy-6e00600d7d2bc54110678823c7ab396822826d4c.zip
Fix intermittent failure of max_frame_size_sent test
Diffstat (limited to 'test')
-rw-r--r--test/http2_SUITE.erl16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/http2_SUITE.erl b/test/http2_SUITE.erl
index 3849303..e3dd4b2 100644
--- a/test/http2_SUITE.erl
+++ b/test/http2_SUITE.erl
@@ -109,13 +109,21 @@ max_frame_size_sent(Config) ->
cow_http2:data(1, fin, <<0:13616/unit:8>>)
]),
%% Receive a HEADERS frame as a response.
- {ok, <<Len:24, 1:8, _:40>>} = gen_tcp:recv(Socket, 9, 6000),
- {ok, _} = gen_tcp:recv(Socket, Len, 6000),
+ {ok, << SkipLen:24, 1:8, _:8, 1:32 >>} = case gen_tcp:recv(Socket, 9, 1000) of
+ %% We received a WINDOW_UPDATE first. Skip it and the next.
+ {ok, <<4:24, 8:8, 0:40>>} ->
+ {ok, _} = gen_tcp:recv(Socket, 4 + 13, 1000),
+ gen_tcp:recv(Socket, 9, 1000);
+ Res ->
+ Res
+ end,
+ {ok, _} = gen_tcp:recv(Socket, SkipLen, 6000),
%% The DATA frames following must have lengths of 20000
%% and then 10000 due to the limit.
{ok, <<20000:24, 0:8, _:40, _:20000/unit:8>>} = gen_tcp:recv(Socket, 20009, 6000),
{ok, <<10000:24, 0:8, _:40, _:10000/unit:8>>} = gen_tcp:recv(Socket, 10009, 6000),
- ok.
+ %% Stop the listener.
+ cowboy:stop_listener(name()).
preface_timeout_infinity(Config) ->
doc("Ensure infinity for preface_timeout is accepted."),
@@ -131,7 +139,7 @@ preface_timeout_infinity(Config) ->
{'DOWN', Ref, process, Pid, Reason} ->
error(Reason)
after 1000 ->
- cowboy:stop_listener(preface_timeout_infinity)
+ cowboy:stop_listener(name())
end.
resp_iolist_body(Config) ->