Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v1] test: flaky replication/wal_off.test.lua test
@ 2020-09-08 11:50 Alexander V. Tikhonov
  2020-09-09 15:45 ` Serge Petrenko
  2020-09-11 10:37 ` Kirill Yukhin
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander V. Tikhonov @ 2020-09-08 11:50 UTC (permalink / raw)
  To: Kirill Yukhin, Serge Petrenko; +Cc: tarantool-patches

On heavy loaded hosts found the following issue:

  [035] --- replication/wal_off.result	Fri Jul  3 04:29:56 2020
  [035] +++ replication/wal_off.reject	Mon Sep  7 15:32:46 2020
  [035] @@ -47,6 +47,8 @@
  [035]  ...
  [035]  while box.info.replication[wal_off_id].upstream.message ~= check do fiber.sleep(0) end
  [035]  ---
  [035] +- error: '[string "while box.info.replication[wal_off_id].upstre..."]:1: attempt to
  [035] +    index field ''upstream'' (a nil value)'
  [035]  ...
  [035]  box.info.replication[wal_off_id].upstream ~= nil
  [035]  ---

It happened because replication upstream status check occurred too
early, when its state was not set. To give the replication status
check routine ability to reach the needed 'stopped' state, it need
to wait for it using test_run:wait_upstream() routine.

Closes #5278
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5278-repl-wal-off
Issue: https://github.com/tarantool/tarantool/issues/5278

 test/replication/wal_off.result   | 16 +---------------
 test/replication/wal_off.test.lua |  6 +-----
 2 files changed, 2 insertions(+), 20 deletions(-)

diff --git a/test/replication/wal_off.result b/test/replication/wal_off.result
index f69e58893..ea7e679f5 100644
--- a/test/replication/wal_off.result
+++ b/test/replication/wal_off.result
@@ -42,13 +42,7 @@ wal_off_id = test_run:eval('wal_off', 'return box.info.id')[1]
 box.cfg { replication = wal_off_uri }
 ---
 ...
-check = "Replication does not support wal_mode = 'none'"
----
-...
-while box.info.replication[wal_off_id].upstream.message ~= check do fiber.sleep(0) end
----
-...
-box.info.replication[wal_off_id].upstream ~= nil
+test_run:wait_upstream(wal_off_id, {status = 'stopped', message_re = "Replication does not support wal_mode = 'none'"})
 ---
 - true
 ...
@@ -56,14 +50,6 @@ box.info.replication[wal_off_id].downstream ~= nil
 ---
 - true
 ...
-box.info.replication[wal_off_id].upstream.status
----
-- stopped
-...
-box.info.replication[wal_off_id].upstream.message
----
-- Replication does not support wal_mode = 'none'
-...
 box.cfg { replication = "" }
 ---
 ...
diff --git a/test/replication/wal_off.test.lua b/test/replication/wal_off.test.lua
index 7298ba1d8..d48d12773 100644
--- a/test/replication/wal_off.test.lua
+++ b/test/replication/wal_off.test.lua
@@ -15,12 +15,8 @@ wal_off_uri ~= nil
 wal_off_id = test_run:eval('wal_off', 'return box.info.id')[1]
 
 box.cfg { replication = wal_off_uri }
-check = "Replication does not support wal_mode = 'none'"
-while box.info.replication[wal_off_id].upstream.message ~= check do fiber.sleep(0) end
-box.info.replication[wal_off_id].upstream ~= nil
+test_run:wait_upstream(wal_off_id, {status = 'stopped', message_re = "Replication does not support wal_mode = 'none'"})
 box.info.replication[wal_off_id].downstream ~= nil
-box.info.replication[wal_off_id].upstream.status
-box.info.replication[wal_off_id].upstream.message
 box.cfg { replication = "" }
 
 test_run:cmd('switch wal_off')
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Tarantool-patches] [PATCH v1] test: flaky replication/wal_off.test.lua test
  2020-09-08 11:50 [Tarantool-patches] [PATCH v1] test: flaky replication/wal_off.test.lua test Alexander V. Tikhonov
@ 2020-09-09 15:45 ` Serge Petrenko
  2020-09-11 10:37 ` Kirill Yukhin
  1 sibling, 0 replies; 3+ messages in thread
From: Serge Petrenko @ 2020-09-09 15:45 UTC (permalink / raw)
  To: Alexander V. Tikhonov, Kirill Yukhin; +Cc: tarantool-patches


08.09.2020 14:50, Alexander V. Tikhonov пишет:
> On heavy loaded hosts found the following issue:
>
>    [035] --- replication/wal_off.result	Fri Jul  3 04:29:56 2020
>    [035] +++ replication/wal_off.reject	Mon Sep  7 15:32:46 2020
>    [035] @@ -47,6 +47,8 @@
>    [035]  ...
>    [035]  while box.info.replication[wal_off_id].upstream.message ~= check do fiber.sleep(0) end
>    [035]  ---
>    [035] +- error: '[string "while box.info.replication[wal_off_id].upstre..."]:1: attempt to
>    [035] +    index field ''upstream'' (a nil value)'
>    [035]  ...
>    [035]  box.info.replication[wal_off_id].upstream ~= nil
>    [035]  ---
>
> It happened because replication upstream status check occurred too
> early, when its state was not set. To give the replication status
> check routine ability to reach the needed 'stopped' state, it need
> to wait for it using test_run:wait_upstream() routine.
>
> Closes #5278
> ---
>
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5278-repl-wal-off
> Issue: https://github.com/tarantool/tarantool/issues/5278
>
>   test/replication/wal_off.result   | 16 +---------------
>   test/replication/wal_off.test.lua |  6 +-----
>   2 files changed, 2 insertions(+), 20 deletions(-)
>
> diff --git a/test/replication/wal_off.result b/test/replication/wal_off.result
> index f69e58893..ea7e679f5 100644
> --- a/test/replication/wal_off.result
> +++ b/test/replication/wal_off.result
> @@ -42,13 +42,7 @@ wal_off_id = test_run:eval('wal_off', 'return box.info.id')[1]
>   box.cfg { replication = wal_off_uri }
>   ---
>   ...
> -check = "Replication does not support wal_mode = 'none'"
> ----
> -...
> -while box.info.replication[wal_off_id].upstream.message ~= check do fiber.sleep(0) end
> ----
> -...
> -box.info.replication[wal_off_id].upstream ~= nil
> +test_run:wait_upstream(wal_off_id, {status = 'stopped', message_re = "Replication does not support wal_mode = 'none'"})
>   ---
>   - true
>   ...
> @@ -56,14 +50,6 @@ box.info.replication[wal_off_id].downstream ~= nil
>   ---
>   - true
>   ...
> -box.info.replication[wal_off_id].upstream.status
> ----
> -- stopped
> -...
> -box.info.replication[wal_off_id].upstream.message
> ----
> -- Replication does not support wal_mode = 'none'
> -...
>   box.cfg { replication = "" }
>   ---
>   ...
> diff --git a/test/replication/wal_off.test.lua b/test/replication/wal_off.test.lua
> index 7298ba1d8..d48d12773 100644
> --- a/test/replication/wal_off.test.lua
> +++ b/test/replication/wal_off.test.lua
> @@ -15,12 +15,8 @@ wal_off_uri ~= nil
>   wal_off_id = test_run:eval('wal_off', 'return box.info.id')[1]
>   
>   box.cfg { replication = wal_off_uri }
> -check = "Replication does not support wal_mode = 'none'"
> -while box.info.replication[wal_off_id].upstream.message ~= check do fiber.sleep(0) end
> -box.info.replication[wal_off_id].upstream ~= nil
> +test_run:wait_upstream(wal_off_id, {status = 'stopped', message_re = "Replication does not support wal_mode = 'none'"})
>   box.info.replication[wal_off_id].downstream ~= nil
> -box.info.replication[wal_off_id].upstream.status
> -box.info.replication[wal_off_id].upstream.message
>   box.cfg { replication = "" }
>   
>   test_run:cmd('switch wal_off')
LGTM

-- 
Serge Petrenko

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Tarantool-patches] [PATCH v1] test: flaky replication/wal_off.test.lua test
  2020-09-08 11:50 [Tarantool-patches] [PATCH v1] test: flaky replication/wal_off.test.lua test Alexander V. Tikhonov
  2020-09-09 15:45 ` Serge Petrenko
@ 2020-09-11 10:37 ` Kirill Yukhin
  1 sibling, 0 replies; 3+ messages in thread
From: Kirill Yukhin @ 2020-09-11 10:37 UTC (permalink / raw)
  To: Alexander V. Tikhonov; +Cc: tarantool-patches

Hello,

On 08 сен 14:50, Alexander V. Tikhonov wrote:
> On heavy loaded hosts found the following issue:
> 
>   [035] --- replication/wal_off.result	Fri Jul  3 04:29:56 2020
>   [035] +++ replication/wal_off.reject	Mon Sep  7 15:32:46 2020
>   [035] @@ -47,6 +47,8 @@
>   [035]  ...
>   [035]  while box.info.replication[wal_off_id].upstream.message ~= check do fiber.sleep(0) end
>   [035]  ---
>   [035] +- error: '[string "while box.info.replication[wal_off_id].upstre..."]:1: attempt to
>   [035] +    index field ''upstream'' (a nil value)'
>   [035]  ...
>   [035]  box.info.replication[wal_off_id].upstream ~= nil
>   [035]  ---
> 
> It happened because replication upstream status check occurred too
> early, when its state was not set. To give the replication status
> check routine ability to reach the needed 'stopped' state, it need
> to wait for it using test_run:wait_upstream() routine.
> 
> Closes #5278
> ---
> 
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5278-repl-wal-off
> Issue: https://github.com/tarantool/tarantool/issues/5278

I've checked your patch into 1.10, 2.4, 2.5 and master.

--
Regards, Kirill Yukhin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-11 10:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 11:50 [Tarantool-patches] [PATCH v1] test: flaky replication/wal_off.test.lua test Alexander V. Tikhonov
2020-09-09 15:45 ` Serge Petrenko
2020-09-11 10:37 ` Kirill Yukhin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox