From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp15.mail.ru (smtp15.mail.ru [94.100.176.133]) (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 72F5C469710 for ; Thu, 21 May 2020 10:59:07 +0300 (MSK) Date: Thu, 21 May 2020 10:59:05 +0300 From: "Alexander V. Tikhonov" Message-ID: <20200521075905.GA333@hpalx> References: <5e8736537209a6b2d45d47a15edb22d8e6a09f59.1589443360.git.avtikhon@tarantool.org> <20200521031558.3ty5x7cgcp6ffaky@tkn_work_nb> <20200521043020.GA30264@hpalx> <20200521061958.wsmyaubx2yqpgpge@tkn_work_nb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200521061958.wsmyaubx2yqpgpge@tkn_work_nb> Subject: Re: [Tarantool-patches] [PATCH v1] test: set unix sockets for iproto at core = app List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Turenko Cc: Oleg Piskunov , tarantool-patches@dev.tarantool.org Alexander, great, you found the root cause of the issue in my patch to test-run, many thanks. I've checked your fix and there is no need for now in my additional changes, so sure I've reverted my patch as you suggested to its initial version. Please check 2nd version of the patch with all your suggestions to tarantoolctl test fix. As about test-run, I've made the new pull request with your patch which I've checked: https://github.com/tarantool/test-run/pull/211 On Thu, May 21, 2020 at 09:19:58AM +0300, Alexander Turenko wrote: > On Thu, May 21, 2020 at 07:30:20AM +0300, Alexander V. Tikhonov wrote: > > Hi Alexander, thanks a lot for the review, I'll try to find the other > > way to fix it. Unfortunately the patch you suggested at the end was the > > same that I've started from, please check: > > > > https://github.com/tarantool/tarantool/commit/ee080600df32f177dcdd5432217d081d3efc22aa > > > > but in this way the tests still fail like I showed at the issue: > > > > https://github.com/tarantool/tarantool/issues/4459#issuecomment-628430495 > > > > that is why I had to find some other way in addition to the fix. > > os.putenv() from a non-default server (say, 'session_storage' instance) > rewrites LISTEN environment variable within the same process, where > AppServer is run. But AppServer is not like TarantoolServer: it spawns a > new child process (tarantool) for each test. > > We can save necessary port/path and put it to environment just before > spawning a new process: > > diff --git a/lib/app_server.py b/lib/app_server.py > index c2d2ea9..2cb8a87 100644 > --- a/lib/app_server.py > +++ b/lib/app_server.py > @@ -19,6 +19,7 @@ from test import TestRunGreenlet, TestExecutionError > > > def run_server(execs, cwd, server, logfile, retval): > + os.putenv("LISTEN", server.iproto) > server.process = Popen(execs, stdout=PIPE, stderr=PIPE, cwd=cwd) > stdout, stderr = server.process.communicate() > sys.stdout.write(stdout) > @@ -108,9 +109,9 @@ class AppServer(Server): > if self.use_unix_sockets_iproto: > path = os.path.join(self.vardir, self.name + ".socket-iproto") > warn_unix_socket(path) > - os.putenv("LISTEN", path) > + self.iproto = path > else: > - os.putenv("LISTEN", str(find_port())) > + self.iproto = str(find_port()) > shutil.copy(os.path.join(self.TEST_RUN_DIR, 'test_run.lua'), > self.vardir) > > WBR, Alexander Turenko.