diff options
author | Bing Han <[email protected]> | 2018-07-05 00:32:07 +0800 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-08-13 11:10:49 +0200 |
commit | e9fd2925ae6be7b6f456e86254b1437d06dfa973 (patch) | |
tree | 39f211031fc987a77481671be0034cd253721100 /test | |
parent | aee40d5bb599237fc159d6684fb308810ac465c3 (diff) | |
download | cowboy-e9fd2925ae6be7b6f456e86254b1437d06dfa973.tar.gz cowboy-e9fd2925ae6be7b6f456e86254b1437d06dfa973.tar.bz2 cowboy-e9fd2925ae6be7b6f456e86254b1437d06dfa973.zip |
Fix cancelling undefined settings timer
when settings_timeout is infinity
Diffstat (limited to 'test')
-rw-r--r-- | test/http2_SUITE.erl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/http2_SUITE.erl b/test/http2_SUITE.erl index e3dd4b2..b71b2c9 100644 --- a/test/http2_SUITE.erl +++ b/test/http2_SUITE.erl @@ -159,3 +159,20 @@ resp_iolist_body(Config) -> {ok, RespBody} = gun:await_body(ConnPid, Ref), Len = iolist_size(RespBody), gun:close(ConnPid). + +settings_timeout_infinity(Config) -> + doc("Ensure infinity for settings_timeout is accepted."), + ProtoOpts = #{ + env => #{dispatch => cowboy_router:compile(init_routes(Config))}, + settings_timeout => infinity + }, + {ok, Pid} = cowboy:start_clear(name(), [{port, 0}], ProtoOpts), + Ref = erlang:monitor(process, Pid), + Port = ranch:get_port(name()), + {ok, _} = do_handshake([{port, Port}|Config]), + receive + {'DOWN', Ref, process, Pid, Reason} -> + error(Reason) + after 1000 -> + cowboy:stop_listener(name()) + end. |