From 6898a3000e642320fba321fc6131b1ad7ccd47d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Wed, 5 Aug 2026 09:51:57 +0200 Subject: [PATCH 1/2] epmd_SUITE: Cuddle slow_get_port_nr/1 Our tests run epmd with a packet_timeout of 1 second, which causes our tests to fail more often now that we're less tolerant of slowloris-like behavior. This commit shortens the artificial delay accordingly. --- erts/epmd/test/epmd_SUITE.erl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl index 9b2ca50944e4..d0c757a5b474 100644 --- a/erts/epmd/test/epmd_SUITE.erl +++ b/erts/epmd/test/epmd_SUITE.erl @@ -398,7 +398,13 @@ get_port_nr(Config) when is_list(Config) -> %% Register with slow write and ask about port nr slow_get_port_nr(Config) when is_list(Config) -> - port_request([?EPMD_PORT2_REQ,d,$f,d,$o,d,$o]). + %% Pause for 200ms. The packet timeout is 1 second as per ?EPMDARGS defined + %% above. + Pause = {pause, 200}, + port_request([?EPMD_PORT2_REQ, + Pause,$f, + Pause,$o, + Pause,$o]). % Internal function used above @@ -1024,9 +1030,8 @@ recv(Sock, Len, Timeout) -> exit(1) end. -%% Send data to socket. The list can be non flat and contain -%% the atom 'd' or tuple {d,Seconds} where this is delay -%% put in between the sent characters. +%% Send data to socket. The list can be nested and contain {pause,Milliseconds} +%% to pause that many milliseconds before sending the next character. send(Sock, SendSpec) -> case send(SendSpec, [], Sock) of @@ -1055,12 +1060,10 @@ send([List | Spec], RevBytes, Sock) when is_list(List) -> Other -> Other end; -send([d | Spec], RevBytes, Sock) -> - send([{d,1000} | Spec], RevBytes, Sock); -send([{d,S} | Spec], RevBytes, Sock) -> +send([{pause, Ms} | Spec], RevBytes, Sock) -> case send_direct(Sock, lists:reverse(RevBytes)) of ok -> - timer:sleep(S), + timer:sleep(Ms), send(Spec, [], Sock); Any -> Any From 79716a878ace0f6130909e4a8763fd697381a63c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Wed, 5 Aug 2026 10:00:20 +0200 Subject: [PATCH 2/2] epmd_SUITE: Fix a deprecation warning --- erts/epmd/test/epmd_SUITE.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erts/epmd/test/epmd_SUITE.erl b/erts/epmd/test/epmd_SUITE.erl index d0c757a5b474..33b496912462 100644 --- a/erts/epmd/test/epmd_SUITE.erl +++ b/erts/epmd/test/epmd_SUITE.erl @@ -374,9 +374,11 @@ parse_line([$n,$a,$m,$e,$ | Buf0]) -> {Name, Buf1} -> case Buf1 of [$a,$t,$ ,$p,$o,$r,$t,$ | Buf2] -> - case catch list_to_integer(Buf2) of - {'EXIT', _} -> error; + try list_to_integer(Buf2) of Port -> {ok, {Name, Port}} + catch + _:_ -> + error end; _ -> error end;