From 6b04c1e188668b1e4b5a2da586a2702c277046de Mon Sep 17 00:00:00 2001 From: "Alexander V. Tikhonov" Date: Wed, 13 May 2020 14:59:49 +0300 Subject: [PATCH] Update 'use_unix_sockets_iproto' for 'core = app' Updated 'use_unix_sockets_iproto' option to support 'core = app' tests, which enabled unix sockets for iproto connections. It helped to handle the problem with 'Address already in use' error. Part of issue https://github.com/tarantool/tarantool/issues/4459 --- lib/app_server.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/app_server.py b/lib/app_server.py index 418d3de4..c2d2ea9b 100644 --- a/lib/app_server.py +++ b/lib/app_server.py @@ -14,6 +14,7 @@ from lib.tarantool_server import TarantoolStartError from lib.utils import find_port from lib.utils import format_process +from lib.utils import warn_unix_socket from test import TestRunGreenlet, TestExecutionError @@ -69,6 +70,7 @@ def __init__(self, _ini=None, test_suite=None): self.name = 'app_server' self.process = None self.binary = TarantoolServer.binary + self.use_unix_sockets_iproto = ini['use_unix_sockets_iproto'] @property def logfile(self): @@ -103,7 +105,12 @@ def deploy(self, vardir=None, silent=True, need_init=True): if (e.errno == errno.ENOENT): continue raise - os.putenv("LISTEN", str(find_port())) + if self.use_unix_sockets_iproto: + path = os.path.join(self.vardir, self.name + ".socket-iproto") + warn_unix_socket(path) + os.putenv("LISTEN", path) + else: + os.putenv("LISTEN", str(find_port())) shutil.copy(os.path.join(self.TEST_RUN_DIR, 'test_run.lua'), self.vardir)