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 10EBE4765E0 for ; Tue, 29 Dec 2020 19:53:37 +0300 (MSK) References: <72c07be7cadc1e78c9394bbc8f1bb64b1a4a4a0c.1609259010.git.artemreyt@tarantool.org> From: Leonid Vasiliev Message-ID: <7b13a9c5-57f8-8c7b-7ca2-92d42cbe85bf@tarantool.org> Date: Tue, 29 Dec 2020 19:53:28 +0300 MIME-Version: 1.0 In-Reply-To: <72c07be7cadc1e78c9394bbc8f1bb64b1a4a4a0c.1609259010.git.artemreyt@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 1/3] test: tarantool -e test add more details and avoid busy loop List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artem Starshov , Alexander Turenko Cc: tarantool-patches@dev.tarantool.org Hi! Thank you for the patch. See a comment bellow: On 29.12.2020 19:25, Artem Starshov wrote: > From: Alexander Turenko > > Background: the test fails on waiting the process termination, but > surprisingly only on GitHub hosted runners. > > My guess is that the process becomes zombie, but we don't collect it. > > A busy loop is not good in general. It is better to pass execution to > other fibers if there is nothing to do. This way the waiting will not > eat 100% CPU time. > > Added collect more details in tarantool -e 'assert(false)' test. > --- > .../gh-4983-tnt-e-assert-false-hangs.test.lua | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/test/app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua b/test/app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua > index 656fe212b..ff3281e0f 100755 > --- a/test/app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua > +++ b/test/app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua > @@ -31,6 +31,7 @@ local function wait_process_completion(pid, timeout) > process_completed = true > break > end > + fiber.sleep(0.01) > end > return process_completed > end > @@ -74,8 +75,18 @@ local res = tap.test('gh-4983-tnt-e-assert-false-hangs', function(test) > local process_completed = wait_process_completion(pid, > process_waiting_timeout) > > + local details It looks like the details are only interesting in case of failure. Maybe we will collect it only in this case? > + pcall(function() > + details = { > + cmdline = fio.open(('/proc/%d/cmdline'):format(pid), > + {'O_RDONLY'}):read(1000000), > + status = fio.open(('/proc/%d/status'):format(pid), > + {'O_RDONLY'}):read(1000000), > + } > + end) > test:ok(process_completed, > - ('tarantool process with pid = %d completed'):format(pid)) > + ('tarantool process with pid = %d completed'):format(pid), > + details) > > -- Kill process if hangs. > if not process_completed then ffi.C.kill(pid, 9) end >