Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: avtikhon <avtikhon@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: [tarantool-patches] Re: [PATCH v1] test: join_vclock test needs fix for high load
Date: Wed, 8 May 2019 16:55:12 +0300	[thread overview]
Message-ID: <20190508135511.4rwujy3dwkdto4ib@tkn_work_nb> (raw)
In-Reply-To: <8c5c4b1b1aaf23a12e895ca6b1498f2a3ca8dae2.1555339308.git.avtikhon@tarantool.org>

ERRINJ_RELAY_FINAL_SLEEP stops until stop_vclock (see
src/box/relay.cc::relay_final_join() for that code and
src/box/box.cc::box_process_join() for the protocol description). So
after it unblocks a data transfer can be in a progress (during final
join or in subscribed state).

The test case checks that there are no holes at this point, so waiting
here looks inappropriate.

The real problem here is that we check amount of tuples in the space and
a content of a last tuple in a separate requests (test-run sends each
line separately to tarantool).

Please, consider this way:

diff --git a/test/replication/join_vclock.test.lua b/test/replication/join_vclock.test.lua
index 0b60dffc2..9bf42041d 100644
--- a/test/replication/join_vclock.test.lua
+++ b/test/replication/join_vclock.test.lua
@@ -26,8 +26,8 @@ ch:get()
 
 errinj.set("ERRINJ_RELAY_FINAL_SLEEP", false)
 test_run:cmd("switch replica1")
-cnt = box.space.test.index[0]:count()
-box.space.test.index.primary:max()[1] == cnt - 1
+cnt = box.space.test.index[0]:count() max = box.space.test.index.primary:max()[1]
+cnt - 1 == max or {cnt - 1, max} -- true
 test_run:cmd("switch default")
 
 replica_set.drop_all(test_run)

It works good for me.

Please ask review from Georgy K. (it is obviously okay for me, because I
propose it myself :)).

WBR, Alexander Turenko.

On Tue, Apr 16, 2019 at 11:01:25AM +0300, avtikhon wrote:
> Join vclock test failed on high load, to resolve it
> need to add wait condition routine:
> 
> [015] Test failed! Result content mismatch:
> [015] --- replication/join_vclock.result Fri Apr 12 14:49:26 2019
> [015] +++ replication/join_vclock.reject Mon Apr 15 17:10:13 2019
> [015] @@ -72,7 +72,7 @@
> [015] ...
> [015] box.space.test.index.primary:max()[1] == cnt - 1
> [015] ---
> [015] -- true
> [015] +- false
> [015] ...
> [015] test_run:cmd("switch default")
> [015] ---
> 
> Close #4160
> ---
> 
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh4160-join-vclock-highload
> Issue: https://github.com/tarantool/tarantool/issues/4160
> 
>  test/replication/join_vclock.result   | 5 +----
>  test/replication/join_vclock.test.lua | 3 +--
>  2 files changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/test/replication/join_vclock.result b/test/replication/join_vclock.result
> index a9781073d..050f68ea6 100644
> --- a/test/replication/join_vclock.result
> +++ b/test/replication/join_vclock.result
> @@ -67,10 +67,7 @@ test_run:cmd("switch replica1")
>  ---
>  - true
>  ...
> -cnt = box.space.test.index[0]:count()
> ----
> -...
> -box.space.test.index.primary:max()[1] == cnt - 1
> +test_run:wait_cond(function() return box.space.test.index.primary:max()[1] == box.space.test.index[0]:count() - 1 end) or box.space.test.index[0]:count()
>  ---
>  - true
>  ...
> diff --git a/test/replication/join_vclock.test.lua b/test/replication/join_vclock.test.lua
> index 0b60dffc2..a404cb48d 100644
> --- a/test/replication/join_vclock.test.lua
> +++ b/test/replication/join_vclock.test.lua
> @@ -26,8 +26,7 @@ ch:get()
>  
>  errinj.set("ERRINJ_RELAY_FINAL_SLEEP", false)
>  test_run:cmd("switch replica1")
> -cnt = box.space.test.index[0]:count()
> -box.space.test.index.primary:max()[1] == cnt - 1
> +test_run:wait_cond(function() return box.space.test.index.primary:max()[1] == box.space.test.index[0]:count() - 1 end) or box.space.test.index[0]:count()
>  test_run:cmd("switch default")
>  
>  replica_set.drop_all(test_run)
> -- 
> 2.17.1
> 

      reply	other threads:[~2019-05-08 13:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-16  8:01 [tarantool-patches] " avtikhon
2019-05-08 13:55 ` Alexander Turenko [this message]

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=20190508135511.4rwujy3dwkdto4ib@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='[tarantool-patches] Re: [PATCH v1] test: join_vclock test needs fix for high load' \
    /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