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 committed Jan 23, 2024
1 parent bfcc9e8 commit 6f15e5d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tarantool_server.py
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 6f15e5d

Please sign in to comment.