Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko <sergepetrenko@tarantool.org>
To: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [avtikhon@tarantool.org: [PATCH v1] test: fix flaky replication/wal_off.test.lua]
Date: Tue, 23 Jun 2020 15:26:06 +0300	[thread overview]
Message-ID: <3bc1cc97-a6f9-0454-4adc-6d339d399782@tarantool.org> (raw)
In-Reply-To: <20200620041241.GB27675@hpalx>


20.06.2020 07:12, Alexander V. Tikhonov пишет:
> ----- Forwarded message from "Alexander V. Tikhonov" <avtikhon@tarantool.org> -----
>
> Date: Fri, 19 Jun 2020 14:48:23 +0300
> From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
> To: Oleg Piskunov <o.piskunov@tarantool.org>, Sergey Bronnikov <sergeyb@tarantool.org>
> Cc: "Alexander V. Tikhonov" <avtikhon@tarantool.org>, Alexander Turenko <alexander.turenko@tarantool.org>, tarantool-patches@dev.tarantool.org
> Subject: [PATCH v1] test: fix flaky replication/wal_off.test.lua
> X-Mailer: git-send-email 2.17.1
>
> Found issue:
>
> [003] --- replication/wal_off.result	Thu Apr 25 13:10:18 2019
> [003] +++ replication/wal_off.reject	Tue Jul 16 17:10:31 2019
> [003] @@ -95,6 +95,8 @@
> [003]  ...
> [003]  while string.find(box.info.replication[wal_off_id].upstream.message, check) == nil do fiber.sleep(0.01) end
> [003]  ---
> [003] +- error: '[string "while string.find(box.info.replication[wal_of..."]:1: bad argument
> [003] +    #1 to ''find'' (string expected, got nil)'
> [003]  ...
> [003]  box.cfg { replication = "" }
> [003]  ---
>
> To check the upstream status and it's message need to wait until an
> upstream appears. This prevents an attempt to index a nil value when
> one of those functions are called before a record about a peer appears
> in box.info.replication. It was observed on test:
>    replication/show_error_on_disconnect
> after commit
>    c6bea65f8ef5f6c737cf70c0127189d0ebcbc36e ('replication: recfg with 0
> quorum returns immediately').
>
> Closes #4355
> ---
>
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4355-replication-wall-off
> Issue: https://github.com/tarantool/tarantool/issues/4355
>
>   test/replication/wal_off.result   | 6 ++----
>   test/replication/wal_off.test.lua | 3 +--
>   2 files changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/test/replication/wal_off.result b/test/replication/wal_off.result
> index e0ae84bd7..f69e58893 100644
> --- a/test/replication/wal_off.result
> +++ b/test/replication/wal_off.result
> @@ -90,11 +90,9 @@ box.cfg { replication = wal_off_uri }
>   box.cfg { replication_sync_timeout = replication_sync_timeout }
>   ---
>   ...
> -check = "Read access to universe"
> ----
> -...
> -while string.find(box.info.replication[wal_off_id].upstream.message, check) == nil do fiber.sleep(0.01) end
> +test_run:wait_upstream(wal_off_id, {status = 'loading', message_re = "Read access to universe"})
>   ---
> +- true
>   ...
>   box.cfg { replication = "" }
>   ---
> diff --git a/test/replication/wal_off.test.lua b/test/replication/wal_off.test.lua
> index 110f2f1f7..7298ba1d8 100644
> --- a/test/replication/wal_off.test.lua
> +++ b/test/replication/wal_off.test.lua
> @@ -31,8 +31,7 @@ replication_sync_timeout = box.cfg.replication_sync_timeout
>   box.cfg { replication_sync_timeout = 0.01 }
>   box.cfg { replication = wal_off_uri }
>   box.cfg { replication_sync_timeout = replication_sync_timeout }
> -check = "Read access to universe"
> -while string.find(box.info.replication[wal_off_id].upstream.message, check) == nil do fiber.sleep(0.01) end
> +test_run:wait_upstream(wal_off_id, {status = 'loading', message_re = "Read access to universe"})
>   box.cfg { replication = "" }
>   
>   test_run:cmd("stop server wal_off")


Thanks for  the patch! LGTM.

-- 
Serge Petrenko

           reply	other threads:[~2020-06-23 12:26 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20200620041241.GB27675@hpalx>]

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=3bc1cc97-a6f9-0454-4adc-6d339d399782@tarantool.org \
    --to=sergepetrenko@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [avtikhon@tarantool.org: [PATCH v1] test: fix flaky replication/wal_off.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