Skip to content

Commit da98d7f

Browse files
0x501Dylobankov
authored andcommitted
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.
1 parent bfcc9e8 commit da98d7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/tarantool_server.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,13 +1314,13 @@ def get_iproto_port(self):
13141314
socket.internal.SO_OPT[lvl].SO_REUSEADDR.iname,
13151315
val, len)
13161316
if val[0] > 0 then
1317-
table.insert(res, addrinfo)
1317+
res[addrinfo.port] = addrinfo
13181318
end
13191319
end
13201320
end
13211321
local l_sockets = {{}}
13221322
local con_timeout = 0.1
1323-
for i, s in ipairs(res) do
1323+
for _, s in pairs(res) do
13241324
con = socket.tcp_connect(s.host, s.port, con_timeout)
13251325
if con then
13261326
con:close()

0 commit comments

Comments
 (0)