[Tarantool-patches] [PATCH v2] Stabilize tcp_connect in test_run:cmd()
Ilya Kosarev
i.kosarev at tarantool.org
Tue Nov 26 03:19:15 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.
Now it is fixed.
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