diff options
author | Loïc Hoguin <[email protected]> | 2015-08-20 16:05:50 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2015-08-20 16:05:50 +0200 |
commit | ee1f82782835096208059ea14d52bf2cc0283323 (patch) | |
tree | 66d0dd5f157b088027a74c546a7f480bd974ae29 /test/acceptor_SUITE.erl | |
parent | c867ec582d445b251ff659ba23f522b5278d5119 (diff) | |
download | ranch-ee1f82782835096208059ea14d52bf2cc0283323.tar.gz ranch-ee1f82782835096208059ea14d52bf2cc0283323.tar.bz2 ranch-ee1f82782835096208059ea14d52bf2cc0283323.zip |
Ensure ranch_conns_sup doesn't crash on protocol start crash
Diffstat (limited to 'test/acceptor_SUITE.erl')
-rw-r--r-- | test/acceptor_SUITE.erl | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/acceptor_SUITE.erl b/test/acceptor_SUITE.erl index af1ea5e..8c0f658 100644 --- a/test/acceptor_SUITE.erl +++ b/test/acceptor_SUITE.erl @@ -48,6 +48,7 @@ groups() -> supervisor_clean_conns_sup_restart, supervisor_clean_restart, supervisor_conns_alive, + supervisor_protocol_start_link_crash, supervisor_server_recover_state ]}]. @@ -459,6 +460,17 @@ supervisor_conns_alive(_) -> ok = clean_traces(), ok = ranch:stop_listener(Name). +supervisor_protocol_start_link_crash(_) -> + doc("Ensure a protocol start crash does not kill all connections."), + Name = supervisor_protocol_start_link_crash, + {ok, _} = ranch:start_listener(Name, 1, ranch_tcp, [], crash_protocol, []), + ConnsSup = ranch_server:get_connections_sup(Name), + Port = ranch:get_port(Name), + {ok, _} = gen_tcp:connect("localhost", Port, [binary, {active, true}, {packet, raw}]), + receive after 500 -> ok end, + ConnsSup = ranch_server:get_connections_sup(Name), + ok = ranch:stop_listener(Name). + supervisor_server_recover_state(_) -> %% Verify that if ranch_server crashes it regains its state and monitors %% ranch_conns_sup that were previously registered. |