Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Serge Petrenko <sergepetrenko@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>,
	Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v9 1/1] applier: filter incoming synchro packets via transaction initiator
Date: Tue, 15 Jun 2021 20:02:59 +0300	[thread overview]
Message-ID: <YMjdQxFYmdSzqcq7@grain> (raw)
In-Reply-To: <c692d3a3-f430-8982-1d31-fc4670d59098@tarantool.org>

On Tue, Jun 15, 2021 at 05:26:06PM +0300, Serge Petrenko wrote:
> > +box.space.sync:select{}
> > + | ---
> > + | - - [1]
> > + | ...
> 
> You need to wait for the space creation, just like
> you do below. Otherwise the test'll be flaky.
> Also, please see a comment regarding wait_lsn vs wait_cond
> below.

As being discussed due to quorum=2 and sync space we don't need
to wait.

> > +test_run:wait_cond(function() return                    \
> > +                   box.space.sync ~= nil and            \
> > +                   box.space.sync:get{1} ~= nil and     \
> > +                   box.space.sync:get{1}[1] == 1 end, 100)
> > + | ---
> > + | - true
> > + | ...
> 
> I suggest you use wait_lsn('replica2', 'master') here
> instead of this bulky wait_cond.
> First of all, it takes a single line, instead of 4 lines.
> 
> Secondly, you forgot to test `box.space.sync.index.pk ~= nil`, meaning
> the test will still fail occasionally, when index creation doesn't replicate
> in time.

You mean something like below?
---
diff --git a/test/replication/gh-6035-applier-filter.result b/test/replication/gh-6035-applier-filter.result
index 2620e7b6f..7345a19f7 100644
--- a/test/replication/gh-6035-applier-filter.result
+++ b/test/replication/gh-6035-applier-filter.result
@@ -102,12 +102,8 @@ test_run:switch('replica2')
  | ---
  | - true
  | ...
-test_run:wait_cond(function() return                    \
-                   box.space.sync ~= nil and            \
-                   box.space.sync:get{1} ~= nil and     \
-                   box.space.sync:get{1}[1] == 1 end, 100)
+test_run:wait_lsn('replica2', 'master')
  | ---
- | - true
  | ...
 box.space.sync:select{}
  | ---
diff --git a/test/replication/gh-6035-applier-filter.test.lua b/test/replication/gh-6035-applier-filter.test.lua
index 9bfd91288..beca5258e 100644
--- a/test/replication/gh-6035-applier-filter.test.lua
+++ b/test/replication/gh-6035-applier-filter.test.lua
@@ -53,10 +53,7 @@ box.space.sync:select{}
 -- And the second hop is replica2 where
 -- replica1 replicated the data to us.
 test_run:switch('replica2')
-test_run:wait_cond(function() return                    \
-                   box.space.sync ~= nil and            \
-                   box.space.sync:get{1} ~= nil and     \
-                   box.space.sync:get{1}[1] == 1 end, 100)
+test_run:wait_lsn('replica2', 'master')
 box.space.sync:select{}
 
 test_run:switch('default')

  reply	other threads:[~2021-06-15 17:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-15 13:56 [Tarantool-patches] [PATCH v9 0/1] " Cyrill Gorcunov via Tarantool-patches
2021-06-15 13:56 ` [Tarantool-patches] [PATCH v9 1/1] " Cyrill Gorcunov via Tarantool-patches
2021-06-15 14:26   ` Serge Petrenko via Tarantool-patches
2021-06-15 17:02     ` Cyrill Gorcunov via Tarantool-patches [this message]
2021-06-15 18:08       ` Cyrill Gorcunov via Tarantool-patches
2021-06-16  8:31         ` Serge Petrenko via Tarantool-patches
2021-06-16  8:43           ` Cyrill Gorcunov via Tarantool-patches
2021-06-16  8:16       ` Serge Petrenko via Tarantool-patches
2021-06-18 21:49 ` [Tarantool-patches] [PATCH v9 0/1] " Vladislav Shpilevoy via Tarantool-patches
2021-06-18 22:16   ` Cyrill Gorcunov via Tarantool-patches
2021-06-18 22:58     ` Vladislav Shpilevoy via Tarantool-patches
2021-06-19 11:01       ` Cyrill Gorcunov via Tarantool-patches
2021-06-20 14:50         ` Vladislav Shpilevoy via Tarantool-patches
2021-06-20 17:17           ` Cyrill Gorcunov via Tarantool-patches
2021-06-21 21:06 ` Vladislav Shpilevoy via Tarantool-patches

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=YMjdQxFYmdSzqcq7@grain \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v9 1/1] applier: filter incoming synchro packets via transaction initiator' \
    /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