Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v2] Stabilize tcp_connect in test_run:cmd()
@ 2019-11-26  0:19 Ilya Kosarev
  0 siblings, 0 replies; 3+ messages in thread
From: Ilya Kosarev @ 2019-11-26  0:19 UTC (permalink / raw)
  To: tarantool-patches

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

^ permalink raw reply	[flat|nested] 3+ messages in thread
* [Tarantool-patches] [PATCH v2] Stabilize tcp_connect in test_run:cmd()
@ 2019-11-26 17:58 Ilya Kosarev
  2019-12-05  1:35 ` Alexander Turenko
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Kosarev @ 2019-11-26 17:58 UTC (permalink / raw)
  To: tarantool-patches

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-12-05  1:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26  0:19 [Tarantool-patches] [PATCH v2] Stabilize tcp_connect in test_run:cmd() Ilya Kosarev
2019-11-26 17:58 Ilya Kosarev
2019-12-05  1:35 ` Alexander Turenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox