From 1560e8cd4ab884f84f1e70d22389aeb5857b7d15 Mon Sep 17 00:00:00 2001 From: Jakub Witczak Date: Mon, 22 Jun 2026 16:12:29 +0200 Subject: [PATCH] ssh: Close socket in kex_strict_helper to prevent eaddrinuse The kex_strict_helper function creates a TCP connection for each test iteration but never closes the client socket. On OpenBSD, the lingering sockets in TIME_WAIT cause gen_tcp:connect to fail with eaddrinuse on subsequent iterations due to ephemeral port collision with {reuseaddr, true}. Add close_socket to the test message sequence so the socket is released before the next iteration begins --- lib/ssh/test/ssh_protocol_SUITE.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ssh/test/ssh_protocol_SUITE.erl b/lib/ssh/test/ssh_protocol_SUITE.erl index b3ff264ea78b..dced411952a4 100644 --- a/lib/ssh/test/ssh_protocol_SUITE.erl +++ b/lib/ssh/test/ssh_protocol_SUITE.erl @@ -1517,7 +1517,8 @@ kex_strict_helper(Config0, TestMessages, ExpectedReason) -> {user_interaction, false} | proplists:get_value(extra_options,Config,[]) ]}] ++ - TestMessages, + TestMessages ++ + [close_socket], InitialState), ct:sleep(100), {ok, Events} = ssh_test_lib:get_log_events(Config),