From 67bd791dcc6138758a9f4d0a071f2369301c7373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 13 Dec 2023 17:24:48 +0100 Subject: Change send_timeout_close test to accomodate macOS --- test/http_SUITE.erl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/http_SUITE.erl') diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index 28118a6..e3ac553 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -556,19 +556,19 @@ send_timeout_close(_Config) -> [ServerSocket] = [PidOrPort || PidOrPort <- ServerLinks, is_port(PidOrPort)], %% Poll the socket repeatedly until it is closed by the server. WaitClosedFun = - fun F(T, Status) when T =< 0 -> - error({status, Status}); - F(T, _) -> - case prim_inet:getstatus(ServerSocket) of + fun F(T) when T =< 0 -> + error({status, prim_inet:getstatus(ServerSocket)}); + F(T) -> + Snooze = 100, + case inet:sockname(ServerSocket) of {error, _} -> - ok; - {ok, Status} -> - Snooze = 100, + timer:sleep(Snooze); + {ok, _} -> timer:sleep(Snooze), - F(T - Snooze, Status) + F(T - Snooze) end end, - ok = WaitClosedFun(2000, undefined), + ok = WaitClosedFun(2000), false = erlang:is_process_alive(StreamPid), false = erlang:is_process_alive(ServerPid) after -- cgit v1.2.3