aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-10-10 16:22:19 +0200
committerLoïc Hoguin <[email protected]>2018-10-10 16:22:19 +0200
commit7d3c65a6db5e267eb0a3f2503c9fa1264b559e73 (patch)
tree5552d175fb5e7838080a1029f1e3fe8d399cbf6b /test
parent2b8ef9b606381f4e5912f815cdf0d5accf00409f (diff)
downloadranch-7d3c65a6db5e267eb0a3f2503c9fa1264b559e73.tar.gz
ranch-7d3c65a6db5e267eb0a3f2503c9fa1264b559e73.tar.bz2
ranch-7d3c65a6db5e267eb0a3f2503c9fa1264b559e73.zip
Fix a race condition on restart after listener_sup crash
The race condition occurs when the restart is faster than the cleaning up. With this commit the restart will perform the cleanup if it was not done beforehand.
Diffstat (limited to 'test')
-rw-r--r--test/acceptor_SUITE.erl22
1 files changed, 0 insertions, 22 deletions
diff --git a/test/acceptor_SUITE.erl b/test/acceptor_SUITE.erl
index 7fd4df2..7deecbb 100644
--- a/test/acceptor_SUITE.erl
+++ b/test/acceptor_SUITE.erl
@@ -72,7 +72,6 @@ groups() ->
connection_type_supervisor_separate_from_connection,
supervisor_changed_options_restart,
supervisor_clean_child_restart,
- supervisor_clean_conns_sup_restart,
supervisor_clean_restart,
supervisor_conns_alive,
supervisor_protocol_start_link_crash,
@@ -1068,27 +1067,6 @@ do_supervisor_clean_child_restart(_) ->
ok = clean_traces(),
ok = ranch:stop_listener(Name).
-supervisor_clean_conns_sup_restart(_) ->
- doc("Verify that a conns_sup can not register with the same name as an already "
- "registered ranch_conns_sup that is still alive. Make sure this does not crash "
- "the ranch_server process."),
- Name = name(),
- {ok, _} = ranch:start_listener(Name,
- ranch_tcp, #{},
- echo_protocol, []),
- Server = erlang:whereis(ranch_server),
- ServerMonRef = erlang:monitor(process, Server),
- %% Exit because Name already registered and is alive.
- {'EXIT', _} = (catch ranch_server:set_connections_sup(Name, self())),
- receive
- {'DOWN', ServerMonRef, process, Server, _} ->
- error(ranch_server_down)
- after
- 1000 ->
- ok
- end,
- ok = ranch:stop_listener(Name).
-
supervisor_clean_restart(Config) ->
case code:is_module_native(?MODULE) of
true -> doc("This test uses tracing and is not compatible with native code.");