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

Fix a test listener not being stopped

This commit is contained in:
Loïc Hoguin 2018-10-31 09:25:19 +01:00
parent 122faedc25
commit 07078eb47b
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764

View file

@ -52,19 +52,12 @@ init_per_group(Name=h2, Config) ->
env => #{dispatch => init_dispatch()}, env => #{dispatch => init_dispatch()},
proxy_header => true proxy_header => true
}, Config); }, Config);
init_per_group(Name=h2c, Config) -> init_per_group(Name, Config) ->
Config1 = cowboy_test:init_http(Name, #{ Config1 = cowboy_test:init_http(Name, #{
env => #{dispatch => init_dispatch()}, env => #{dispatch => init_dispatch()},
proxy_header => true proxy_header => true
}, Config), }, Config),
lists:keyreplace(protocol, 1, Config1, {protocol, http2}); lists:keyreplace(protocol, 1, Config1, {protocol, http2}).
init_per_group(Name=h2c_upgrade, Config) ->
Config1 = cowboy_test:init_http(h2c, #{
env => #{dispatch => init_dispatch()},
proxy_header => true
}, Config),
Config2 = lists:keyreplace(protocol, 1, Config1, {protocol, http2}),
lists:keyreplace(ref, 1, Config2, {ref, Name}).
end_per_group(Name, _) -> end_per_group(Name, _) ->
cowboy:stop_listener(Name). cowboy:stop_listener(Name).