From ff674fe6e872e31d74bcec9a3bccff27cf0dd4f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 20 Nov 2018 11:28:25 +0100 Subject: Wait for the connection to be up in a few tests --- test/http_SUITE.erl | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index 4828747..30b158d 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -107,6 +107,7 @@ idle_timeout_infinity(Config) -> Port = ranch:get_port(?FUNCTION_NAME), try ConnPid = gun_open([{type, tcp}, {protocol, http}, {port, Port}|Config]), + {ok, http} = gun:await_up(ConnPid), _ = gun:post(ConnPid, "/echo/read_body", [{<<"content-type">>, <<"text/plain">>}]), #{socket := Socket} = gun:info(ConnPid), @@ -131,6 +132,7 @@ request_timeout_infinity(Config) -> Port = ranch:get_port(?FUNCTION_NAME), try ConnPid = gun_open([{type, tcp}, {protocol, http}, {port, Port}|Config]), + {ok, http} = gun:await_up(ConnPid), #{socket := Socket} = gun:info(ConnPid), Pid = get_remote_pid_tcp(Socket), Ref = erlang:monitor(process, Pid), @@ -208,6 +210,7 @@ set_options_idle_timeout(Config) -> Port = ranch:get_port(?FUNCTION_NAME), try ConnPid = gun_open([{type, tcp}, {protocol, http}, {port, Port}|Config]), + {ok, http} = gun:await_up(ConnPid), _ = gun:post(ConnPid, "/set_options/idle_timeout_short", [{<<"content-type">>, <<"text/plain">>}]), #{socket := Socket} = gun:info(ConnPid), @@ -233,6 +236,7 @@ set_options_idle_timeout_only_applies_to_current_request(Config) -> Port = ranch:get_port(?FUNCTION_NAME), try ConnPid = gun_open([{type, tcp}, {protocol, http}, {port, Port}|Config]), + {ok, http} = gun:await_up(ConnPid), StreamRef = gun:post(ConnPid, "/set_options/idle_timeout_long", [{<<"content-type">>, <<"text/plain">>}]), #{socket := Socket} = gun:info(ConnPid), -- cgit v1.2.3