From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp39.i.mail.ru (smtp39.i.mail.ru [94.100.177.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1D09746970F for ; Tue, 26 Nov 2019 20:59:02 +0300 (MSK) From: Ilya Kosarev Date: Tue, 26 Nov 2019 20:58:59 +0300 Message-Id: <20191126175859.21804-1-i.kosarev@tarantool.org> Subject: [Tarantool-patches] [PATCH v2] Stabilize tcp_connect in test_run:cmd() List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org 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