Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@freelists.org, Kirill Yukhin <kyukhin@tarantool.org>
Subject: [tarantool-patches] Re: [PATCH 1/1] test: fix flaky swim/errinj.test.lua
Date: Wed, 31 Jul 2019 11:23:24 +0300	[thread overview]
Message-ID: <20190731082323.gn2dlibe7lntwuln@tkn_work_nb> (raw)
In-Reply-To: <55cb38fd-df67-6858-5330-9c27a66adbd4@tarantool.org>

> >> diff --git a/test/swim/errinj.test.lua b/test/swim/errinj.test.lua
> >> index cf0cb2dd4..6c73f9f3d 100644
> >> --- a/test/swim/errinj.test.lua
> >> +++ b/test/swim/errinj.test.lua
> >> @@ -26,6 +26,7 @@ s1:self():incarnation()
> >>  errinj.set("ERRINJ_SWIM_FD_ONLY", true)
> >>  s1:probe_member(s2:self():uri())
> >>  errinj.set("ERRINJ_SWIM_FD_ONLY", false)
> >> +while s1_view:incarnation().version ~= 2 do fiber.sleep(0.01) end
> > 
> > Nit: Maybe it will be a bit better to stop after a certain time period
> > if a condition is not meet after, say, a minute: this will allow
> > test-run to continue with the test and possibly show more compact
> > miscompare fail and also will allow continue with other tests that was
> > already scheduled to the same worker. We use test_run:wait_cond() for
> > this. Anyway, this is a thing of preference and I don't push anyone to
> > one or another way: this message it just to let you know about both ways
> > and the difference between them. (From the other hand explicit is better
> > then implicit.)
> 
> Such places are widespread in our tests. Perhaps it is worth introducing
> a test-run helper for that. For example:
> 
>     test_run:wait(function() ... end, timeout)
> 
> The function should return true, when the condition is met. This case
> would look like this:
> 
>     test_run:wait(function()                                \
>         return s1_view:incarnation().version == 2           \
>     end, 60)

I have mentioned it above: test_run:wait_cond(func, timeout, delay).
https://github.com/tarantool/test-run/blob/947c65cda7f26ceb5f601bbf154e70f9c3f755e9/test_run.lua#L387

  reply	other threads:[~2019-07-31  8:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-30 19:34 [tarantool-patches] " Vladislav Shpilevoy
2019-07-30 22:44 ` [tarantool-patches] " Alexander Turenko
2019-07-30 22:58   ` Vladislav Shpilevoy
2019-07-31  8:23     ` Alexander Turenko [this message]
2019-08-09 10:18 ` Kirill Yukhin
2019-08-11 22:42   ` Alexander Turenko

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=20190731082323.gn2dlibe7lntwuln@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='[tarantool-patches] Re: [PATCH 1/1] test: fix flaky swim/errinj.test.lua' \
    /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