Skip to content

Commit

Permalink
test: fix tests due to timings
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhuyan committed Sep 18, 2023
1 parent f7ee0a7 commit 59f685d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/quicer_listener_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ tc_open_listener(Config) ->
{ok, {_, Port}} = quicer:sockname(L),
{error, eaddrinuse} = gen_udp:open(Port),
ok = quicer:close_listener(L),
{ok, P} = gen_udp:open(Port),
{ok, P} = snabbkaffe:retry(100, 10, fun()-> gen_udp:open(Port) end),
ok = gen_udp:close(P),
ok.

Expand Down Expand Up @@ -254,19 +254,19 @@ tc_open_listener_bind(Config) ->
ListenOn = "127.0.0.1:4567",
{ok, L} = quicer:listen(ListenOn, default_listen_opts(Config)),
{ok, {_, _}} = quicer:sockname(L),
{error,eaddrinuse} = gen_udp:open(4567),
{error, eaddrinuse} = gen_udp:open(4567),
ok = quicer:close_listener(L),
{ok, P} = gen_udp:open(4567),
{ok, P} = snabbkaffe:retry(100, 10, fun() -> gen_udp:open(4567) end),
ok = gen_udp:close(P),
ok.

tc_open_listener_bind_v6(Config) ->
ListenOn = "[::1]:4567",
{ok, L} = quicer:listen(ListenOn, default_listen_opts(Config)),
{ok, {_, _}} = quicer:sockname(L),
{error,eaddrinuse} = gen_udp:open(4567, [{ip, {0, 0, 0, 0, 0, 0, 0, 1}}]),
{error, eaddrinuse} = gen_udp:open(4567, [{ip, {0, 0, 0, 0, 0, 0, 0, 1}}]),
ok = quicer:close_listener(L),
{ok, P} = gen_udp:open(4567, [{ip, {0, 0, 0, 0, 0, 0, 0, 1}}]),
{ok, P} = snabbkaffe:retry(100, 10, fun() -> gen_udp:open(4567, [{ip, {0, 0, 0, 0, 0, 0, 0, 1}}]) end),
ok = gen_udp:close(P),
ok.

Expand Down Expand Up @@ -325,7 +325,7 @@ tc_stop_start_listener(Config) ->
LConf = default_listen_opts(Config),
{ok, L} = quicer:listen(Port, LConf),
ok = quicer:stop_listener(L),
ok = quicer:start_listener(L, Port, LConf),
ok = snabbkaffe:retry(100, 10, fun() -> quicer:start_listener(L, Port, LConf) end),
ok = quicer:close_listener(L).

tc_stop_close_listener(Config) ->
Expand Down
1 change: 0 additions & 1 deletion test/quicer_snb_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,6 @@ tc_conn_stop_notify_acceptor(Config) ->
end,
exit({normal, Acceptors})
end),
timer:sleep(1000),
{ok, Conn} = quicer:connect("localhost", Port, default_conn_opts(), infinity),
quicer:shutdown_connection(Conn),

Expand Down

0 comments on commit 59f685d

Please sign in to comment.