0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Handle system messages in cowboy_websocket

This commit is contained in:
Loïc Hoguin 2018-03-13 11:19:13 +01:00
parent b9c8d86502
commit f9092126fa
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
4 changed files with 39 additions and 5 deletions

View file

@ -27,6 +27,8 @@ groups() ->
[{sys, [parallel], ct_helper:all(?MODULE)}].
init_per_suite(Config) ->
ct:print("This test suite will produce error reports about "
"EXIT signals for unknown processes."),
ProtoOpts = #{
env => #{dispatch => init_dispatch(Config)}
},
@ -467,8 +469,7 @@ trap_exit_other_exit_ws(Config) ->
{ok, {http_response, {1, 1}, 101, _}, _} = erlang:decode_packet(http, Handshake, []),
timer:sleep(100),
Pid = do_get_remote_pid_tcp(Socket),
Parent = do_get_parent_pid(Pid),
Pid ! {'EXIT', Parent, shutdown},
Pid ! {'EXIT', self(), shutdown},
%% The process stays alive.
{error, timeout} = gen_tcp:recv(Socket, 0, 1000),
true = is_process_alive(Pid),