From: Alexander Turenko <alexander.turenko@tarantool.org> To: Artem Starshov <artemreyt@tarantool.org> Cc: tarantool-patches@dev.tarantool.org Subject: Re: [Tarantool-patches] [PATCH 1/3] test: tarantool -e test add more details and avoid busy loop Date: Tue, 29 Dec 2020 23:11:02 +0300 [thread overview] Message-ID: <20201229201102.cmrgcrzvlenyn7wf@tkn_work_nb> (raw) In-Reply-To: <72c07be7cadc1e78c9394bbc8f1bb64b1a4a4a0c.1609259010.git.artemreyt@tarantool.org> On Tue, Dec 29, 2020 at 07:25:33PM +0300, Artem Starshov wrote: > From: Alexander Turenko <alexander.turenko@tarantool.org> I would prefer if you would send patches from youself. > > 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. I wrote this as brief notes for my experiments, then we observed that it is not so. The process is not a direct child of our one. > > 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 > + 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) It is Linux specific, so the change is dubious. > 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 > -- > 2.28.0 >
next prev parent reply other threads:[~2020-12-29 20:10 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-29 16:25 [Tarantool-patches] [PATCH 0/3] test: -e assert(false) test fixup Artem Starshov 2020-12-29 16:25 ` [Tarantool-patches] [PATCH 1/3] test: tarantool -e test add more details and avoid busy loop Artem Starshov 2020-12-29 16:53 ` Leonid Vasiliev 2020-12-29 20:11 ` Alexander Turenko [this message] 2020-12-29 16:25 ` [Tarantool-patches] [PATCH 2/3] github-ci: add init option for containers Artem Starshov 2020-12-29 16:57 ` Leonid Vasiliev 2020-12-29 18:32 ` Alexander V. Tikhonov 2020-12-29 19:25 ` Alexander Turenko 2020-12-29 16:25 ` [Tarantool-patches] [PATCH 3/3] test: new version for -e assert(false) test Artem Starshov 2020-12-29 17:07 ` Leonid Vasiliev 2020-12-29 20:16 ` Alexander Turenko 2020-12-29 16:45 ` [Tarantool-patches] [PATCH 0/3] test: -e assert(false) test fixup Artem 2020-12-29 17:11 ` Leonid Vasiliev
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=20201229201102.cmrgcrzvlenyn7wf@tkn_work_nb \ --to=alexander.turenko@tarantool.org \ --cc=artemreyt@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/3] test: tarantool -e test add more details and avoid busy loop' \ /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