Skip to content

Commit

Permalink
add acceptor_leak_regression to ssl_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sg2342 committed Sep 30, 2020
1 parent c919553 commit 192a7ab
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/elli_ssl_tests.erl
Expand Up @@ -12,7 +12,8 @@ elli_ssl_test_() ->
[
?_test(hello_world()),
?_test(chunked()),
?_test(sendfile())
?_test(sendfile()),
?_test(acceptor_leak_regression())
]}
]}.

Expand Down Expand Up @@ -67,6 +68,13 @@ sendfile() ->
?assertNotMatch(undefined, get_timing_value(send_end)),
?assertNotMatch(undefined, get_timing_value(request_end)).

acceptor_leak_regression() ->
{ok, Before} = elli:get_acceptors(elli_under_test),
Opts = [{verify, verify_peer}, {verify_fun, fun(_,_) -> {fail,23} end}],
{error, _} = ssl:connect("localhost", 3443, Opts),
{ok, After} = elli:get_acceptors(elli_under_test),
?assertEqual(length(Before), length(After)).

%%% Internal helpers

setup() ->
Expand Down Expand Up @@ -98,6 +106,7 @@ setup() ->
{callback_args, Config}
]),
unlink(P),
erlang:register(elli_under_test, P),
[P].

teardown(Pids) ->
Expand Down

0 comments on commit 192a7ab

Please sign in to comment.