Skip to content

Commit bee3c9a

Browse files
committed
Random name for unix socket cowboy listeners
1 parent 93db46e commit bee3c9a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/katipo_SUITE.erl

+6-3
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ end_per_suite(_Config) ->
2424
init_per_group(http, Config) ->
2525
application:ensure_all_started(cowboy),
2626
Filename = tempfile:name("katipo_test_"),
27+
Name = make_ref(),
2728
Dispatch = cowboy_router:compile([{'_', [{"/unix", get_handler, []}]}]),
28-
{ok, _} = cowboy:start_clear(unix_socket, [{ip, {local, Filename}},
29-
{port, 0}], #{env => #{dispatch => Dispatch}}),
30-
[{unix_socket_file, Filename} | Config];
29+
{ok, _} = cowboy:start_clear(Name, [{ip, {local, Filename}},
30+
{port, 0}], #{env => #{dispatch => Dispatch}}),
31+
[{unix_socket_file, Filename}, {unix_server_name, Name}] ++ Config;
3132
init_per_group(session, Config) ->
3233
application:ensure_all_started(katipo),
3334
Config;
@@ -48,7 +49,9 @@ init_per_group(_, Config) ->
4849

4950
end_per_group(http, Config) ->
5051
Filename = ?config(unix_socket_file, Config),
52+
Name = ?config(unix_server_name, Config),
5153
_ = file:delete(Filename),
54+
ok = cowboy:stop_listener(Name),
5255
Config;
5356
end_per_group(pool, Config) ->
5457
application:stop(meck),

0 commit comments

Comments
 (0)