Skip to content

Commit

Permalink
get_iproto_port: remove duplicates
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
0x501D authored and ylobankov committed Jan 24, 2024
1 parent bfcc9e8 commit da98d7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tarantool_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit da98d7f

Please sign in to comment.