From 6f15e5ddedafbeb9141657b2123ab9d3c3289e40 Mon Sep 17 00:00:00 2001 From: Pavel Balaev Date: Tue, 23 Jan 2024 13:38:22 +0300 Subject: [PATCH] get_iproto_port: remove duplicates In some tests, instances have duplicate file descriptors on one socket, which leads to abnormal termination of the test. This patch removes duplicates to work around this problem. --- lib/tarantool_server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tarantool_server.py b/lib/tarantool_server.py index 22bdc28b..e7c217c3 100644 --- a/lib/tarantool_server.py +++ b/lib/tarantool_server.py @@ -1314,13 +1314,13 @@ def get_iproto_port(self): socket.internal.SO_OPT[lvl].SO_REUSEADDR.iname, val, len) if val[0] > 0 then - table.insert(res, addrinfo) + res[addrinfo.port] = addrinfo end end end local l_sockets = {{}} local con_timeout = 0.1 - for i, s in ipairs(res) do + for _, s in pairs(res) do con = socket.tcp_connect(s.host, s.port, con_timeout) if con then con:close()