Skip to content

Commit

Permalink
Add test for repeated starting and stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
juhlig committed Nov 7, 2024
1 parent 6ecebfc commit 791e095
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/acceptor_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ groups() ->
misc_wait_for_connections,
misc_multiple_ip_local_socket_opts,
misc_connection_alarms,
misc_stop_unknown_listener
misc_stop_unknown_listener,
misc_repeated_start_stop
]}, {supervisor, [
connection_type_supervisor,
connection_type_supervisor_separate_from_connection,
Expand Down Expand Up @@ -665,6 +666,21 @@ misc_stop_unknown_listener(_) ->
{error, not_found} = ranch:stop_listener(make_ref()),
ok.

misc_repeated_start_stop(_) ->
doc("Ensure that repeated starts and stops of a listener works."),
Name = name(),
lists:foreach(
fun(_) ->
{ok, _} = ranch:start_listener(Name, ranch_tcp, #{}, echo_protocol, []),
true = is_integer(ranch:get_port(Name)),
ok = ranch:stop_listener(Name),
{'EXIT', _} = begin catch ranch:get_port(Name) end
end,
lists:seq(1, 10)
),
ok.


%% ssl.

ssl_accept_error(_) ->
Expand Down

0 comments on commit 791e095

Please sign in to comment.