Skip to content

Commit

Permalink
Don't assume port 1805 is free
Browse files Browse the repository at this point in the history
It can be taken, leading to unexpected failures.
Just use any free port (passing '0' works like this).
  • Loading branch information
chrzaszcz committed Mar 16, 2023
1 parent 4443ed1 commit c55547f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/mongooseim_metrics_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ tcp_connections_detected(_C) ->

tcp_metric_varies_with_tcp_variations(_C) ->
X = get_new_tcp_metric_value({ok, []}),
{ok, Socket} = gen_tcp:listen(1805, []),
{ok, Socket} = gen_tcp:listen(0, []),
Y = get_new_tcp_metric_value({ok, [{value, X}]}),
?assert(Y == X + 1),
gen_tcp:close(Socket),
Expand Down

0 comments on commit c55547f

Please sign in to comment.