aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-04-01 21:11:59 +0200
committerLoïc Hoguin <[email protected]>2020-04-01 21:11:59 +0200
commit2b65b575c65ed097220d58116e246a16cee500b1 (patch)
tree53aec46ac79edd51b0ffc3d36260a0b127fa2c5d /test
parent8471788826faf0f05f16abbb1ed0b0da6befdb8d (diff)
downloadcowboy-2b65b575c65ed097220d58116e246a16cee500b1.tar.gz
cowboy-2b65b575c65ed097220d58116e246a16cee500b1.tar.bz2
cowboy-2b65b575c65ed097220d58116e246a16cee500b1.zip
Change a few flaky tests to use timetrap and infinity timeouts
The experiment was successful in Gun, let's see if it helps with Cowboy as well.
Diffstat (limited to 'test')
-rw-r--r--test/req_SUITE.erl9
-rw-r--r--test/rfc7230_SUITE.erl11
2 files changed, 13 insertions, 7 deletions
diff --git a/test/req_SUITE.erl b/test/req_SUITE.erl
index f71883f..b7ffbc9 100644
--- a/test/req_SUITE.erl
+++ b/test/req_SUITE.erl
@@ -22,6 +22,9 @@
%% ct.
+suite() ->
+ [{timetrap, 30000}].
+
all() ->
cowboy_test:common_all().
@@ -532,11 +535,11 @@ do_read_body_expect_100_continue(Path, Config) ->
{<<"content-length">>, integer_to_binary(byte_size(Body))}
],
Ref = gun:post(ConnPid, Path, Headers),
- {inform, 100, []} = gun:await(ConnPid, Ref),
+ {inform, 100, []} = gun:await(ConnPid, Ref, infinity),
gun:data(ConnPid, Ref, fin, Body),
- {response, IsFin, 200, RespHeaders} = gun:await(ConnPid, Ref),
+ {response, IsFin, 200, RespHeaders} = gun:await(ConnPid, Ref, infinity),
{ok, RespBody} = case IsFin of
- nofin -> gun:await_body(ConnPid, Ref);
+ nofin -> gun:await_body(ConnPid, Ref, infinity);
fin -> {ok, <<>>}
end,
gun:close(ConnPid),
diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl
index 5b699e8..0097b7d 100644
--- a/test/rfc7230_SUITE.erl
+++ b/test/rfc7230_SUITE.erl
@@ -24,6 +24,9 @@
-import(cowboy_test, [raw_recv_head/1]).
-import(cowboy_test, [raw_recv/3]).
+suite() ->
+ [{timetrap, 30000}].
+
all() -> [{group, http}].
groups() -> [{http, [parallel], ct_helper:all(?MODULE)}].
@@ -1557,10 +1560,10 @@ pipeline(Config) ->
gun:post(ConnPid, "/full/read_body", [], <<0:800000>>)
} || _ <- lists:seq(1, 25)],
_ = [begin
- {response, nofin, 200, _} = gun:await(ConnPid, Ref1),
- {ok, <<"Hello world!">>} = gun:await_body(ConnPid, Ref1),
- {response, nofin, 200, _} = gun:await(ConnPid, Ref2),
- {ok, <<0:800000>>} = gun:await_body(ConnPid, Ref2)
+ {response, nofin, 200, _} = gun:await(ConnPid, Ref1, infinity),
+ {ok, <<"Hello world!">>} = gun:await_body(ConnPid, Ref1, infinity),
+ {response, nofin, 200, _} = gun:await(ConnPid, Ref2, infinity),
+ {ok, <<0:800000>>} = gun:await_body(ConnPid, Ref2, infinity)
end || {Ref1, Ref2} <- Refs],
ok.