[Tarantool-patches] [PATCH v2] Stabilize tcp_connect in test_run:cmd()

Ilya Kosarev i.kosarev at tarantool.org
Tue Nov 26 20:58:59 MSK 2019


For some tests, for example, replication/box_set_replication_stress,
socket.tcp_connect() in test_run:cmd() might sometimes fail with
"Too many open files" error when running under high load. In case of
box_set_replication_stress test it happens because of a huge number of
file descriptors being opened during many box_set_replication calls.
Under high load it takes time for them to be closed. Now we are trying
to perform socket.tcp_connect() under test_run:wait_cond() clause until
we succeed or time is gone.

Closes #193
---
https://github.com/tarantool/test-run/tree/i.kosarev/gh-193-stabilize-test-run-cmd
https://github.com/tarantool/test-run/issues/193

Changes in v2:
- replaced infinite loop with wait_cond

 test_run.lua | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/test_run.lua b/test_run.lua
index 63dfdef..804d42c 100644
--- a/test_run.lua
+++ b/test_run.lua
@@ -10,7 +10,11 @@ local errno = require('errno')
 local clock = require('clock')
 
 local function cmd(self, msg)
-    local sock = socket.tcp_connect(self.host, self.port)
+    local sock = nil
+    self:wait_cond(function()
+        sock = socket.tcp_connect(self.host, self.port)
+        return sock ~= nil
+    end, 100)
     local data = msg .. '\n'
     sock:send(data)
 
-- 
2.17.1



More information about the Tarantool-patches mailing list