Tarantool development patches archive
 help / color / mirror / Atom feed
From: Ilya Kosarev <i.kosarev@tarantool.org>
To: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v2] Stabilize tcp_connect in test_run:cmd()
Date: Tue, 26 Nov 2019 03:19:15 +0300	[thread overview]
Message-ID: <20191126001915.16986-1-i.kosarev@tarantool.org> (raw)

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

             reply	other threads:[~2019-11-26  0:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  0:19 Ilya Kosarev [this message]
2019-11-26 17:58 Ilya Kosarev
2019-12-05  1:35 ` Alexander Turenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191126001915.16986-1-i.kosarev@tarantool.org \
    --to=i.kosarev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] Stabilize tcp_connect in test_run:cmd()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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