Skip to content

Commit

Permalink
Test proxy disconnection
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonVides committed May 13, 2021
1 parent d93b9c8 commit 55efbb1
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/proxy_header_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,23 @@ init_dispatch() ->

%% Tests.

fail_gracefully_on_disconnect(Config) ->
doc("Probing a port does not generate a crash"),
{ok, Socket} = gen_tcp:connect("localhost", config(port, Config),
[binary, {active, false}, {packet, raw}]),
timer:sleep(100),
Pid = ct_helper:get_remote_pid_tcp(Socket),
Ref = erlang:monitor(process, Pid),
gen_tcp:close(Socket),
receive
{'DOWN', Ref, process, Pid, {shutdown, closed}} ->
ok;
{'DOWN', Ref, process, Pid, Reason} ->
error(Reason)
after 500 ->
error(timeout)
end.

v1_proxy_header(Config) ->
doc("Confirm we can read the proxy header at the start of the connection."),
ProxyInfo = #{
Expand Down

0 comments on commit 55efbb1

Please sign in to comment.