Skip to content

Commit

Permalink
Prevent crashing after http_auth is started
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekwegr committed Mar 13, 2024
1 parent 468b1df commit a75eaf1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 10 additions & 2 deletions big_tests/tests/http_helper.erl
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@
start(Port, Path, HandleFun) ->
application:ensure_all_started(cowboy),
Dispatch = cowboy_router:compile([{'_', [{Path, http_helper, HandleFun}]}]),
{ok, _} = cowboy:start_clear(http_helper_listener, [{port, Port}],
#{env => #{dispatch => Dispatch}}).
case cowboy:start_clear(http_helper_listener, [{port, Port}],
#{env => #{dispatch => Dispatch}}) of
{ok, Pid} ->
{ok, Pid};
{error, {already_started, _}} ->
ct:log("http_helper_listener was already running. Restarting it."),
stop(),
{ok, _} = cowboy:start_clear(http_helper_listener, [{port, Port}],
#{env => #{dispatch => Dispatch}})
end.

stop() ->
cowboy:stop_listener(http_helper_listener).
Expand Down
1 change: 0 additions & 1 deletion big_tests/tests/muc_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ end_per_suite(Config) ->
dynamic_modules:restore_modules(Config),
escalus:end_per_suite(Config).


init_per_group(room_registration_race_condition, Config) ->
escalus_fresh:create_users(Config, [{alice, 1}]);

Expand Down

0 comments on commit a75eaf1

Please sign in to comment.