@@ -24,10 +24,11 @@ end_per_suite(_Config) ->
24
24
init_per_group (http , Config ) ->
25
25
application :ensure_all_started (cowboy ),
26
26
Filename = tempfile :name (" katipo_test_" ),
27
+ Name = make_ref (),
27
28
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 ;
31
32
init_per_group (session , Config ) ->
32
33
application :ensure_all_started (katipo ),
33
34
Config ;
@@ -48,7 +49,9 @@ init_per_group(_, Config) ->
48
49
49
50
end_per_group (http , Config ) ->
50
51
Filename = ? config (unix_socket_file , Config ),
52
+ Name = ? config (unix_server_name , Config ),
51
53
_ = file :delete (Filename ),
54
+ ok = cowboy :stop_listener (Name ),
52
55
Config ;
53
56
end_per_group (pool , Config ) ->
54
57
application :stop (meck ),
0 commit comments