Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v1] test: replication/wal_rw_stress fix wait_cond
@ 2020-07-14 10:42 Alexander V. Tikhonov
  2020-07-14 11:24 ` Kirill Yukhin
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander V. Tikhonov @ 2020-07-14 10:42 UTC (permalink / raw)
  To: Kirill Yukhin, Alexander Turenko; +Cc: tarantool-patches

Found that on heavy loaded hosts the test tries to check replication
downstream status when downstream structure is not ready and it fails
with the error:

[017] --- replication/wal_rw_stress.result	Thu Jul  9 17:04:16 2020
[017] +++ replication/wal_rw_stress.reject	Fri May  8 08:25:15 2020
[017] @@ -75,7 +75,8 @@
[017]      return box.info.replication[1].downstream.status ~= 'stopped' \
[017]  end) or box.info
[017]  ---
[017] -- true
[017] +- error: '[string "return test_run:wait_cond(function()         ..."]:1: attempt to
[017] +    index field ''downstream'' (a nil value)'
[017]  ...
[017]  test_run:cmd("switch default")
[017]  ---
[017]

So the wait condition should start from the check of the downstream
structure availability.

Follows up #4977
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4977-test-replication-wal_rw_stress
Issue: https://github.com/tarantool/tarantool/issues/4977

 test/replication/wal_rw_stress.result   | 6 ++++--
 test/replication/wal_rw_stress.test.lua | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/test/replication/wal_rw_stress.result b/test/replication/wal_rw_stress.result
index 50cfb08c7..41f307fc2 100644
--- a/test/replication/wal_rw_stress.result
+++ b/test/replication/wal_rw_stress.result
@@ -71,8 +71,10 @@ test_run:cmd("switch replica")
 box.cfg{replication = replication}
 ---
 ...
-test_run:wait_cond(function()                                     \
-    return box.info.replication[1].downstream.status ~= 'stopped' \
+test_run:wait_cond(function()                    \
+    local r = box.info.replication[1]            \
+    return (r ~= nil and r.downstream ~= nil and \
+            r.downstream.status ~= 'stopped')    \
 end) or box.info
 ---
 - true
diff --git a/test/replication/wal_rw_stress.test.lua b/test/replication/wal_rw_stress.test.lua
index e9b948518..96df2d6bf 100644
--- a/test/replication/wal_rw_stress.test.lua
+++ b/test/replication/wal_rw_stress.test.lua
@@ -38,8 +38,10 @@ test_run:cmd("setopt delimiter ''");
 -- are running in different threads, there shouldn't be any rw errors.
 test_run:cmd("switch replica")
 box.cfg{replication = replication}
-test_run:wait_cond(function()                                     \
-    return box.info.replication[1].downstream.status ~= 'stopped' \
+test_run:wait_cond(function()                    \
+    local r = box.info.replication[1]            \
+    return (r ~= nil and r.downstream ~= nil and \
+            r.downstream.status ~= 'stopped')    \
 end) or box.info
 test_run:cmd("switch default")
 
-- 
2.17.1

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

* Re: [Tarantool-patches] [PATCH v1] test: replication/wal_rw_stress fix wait_cond
  2020-07-14 10:42 [Tarantool-patches] [PATCH v1] test: replication/wal_rw_stress fix wait_cond Alexander V. Tikhonov
@ 2020-07-14 11:24 ` Kirill Yukhin
  0 siblings, 0 replies; 2+ messages in thread
From: Kirill Yukhin @ 2020-07-14 11:24 UTC (permalink / raw)
  To: Alexander V. Tikhonov; +Cc: tarantool-patches, Alexander Turenko

Hello,

On 14 июл 13:42, Alexander V. Tikhonov wrote:
> Found that on heavy loaded hosts the test tries to check replication
> downstream status when downstream structure is not ready and it fails
> with the error:
> 
> [017] --- replication/wal_rw_stress.result	Thu Jul  9 17:04:16 2020
> [017] +++ replication/wal_rw_stress.reject	Fri May  8 08:25:15 2020
> [017] @@ -75,7 +75,8 @@
> [017]      return box.info.replication[1].downstream.status ~= 'stopped' \
> [017]  end) or box.info
> [017]  ---
> [017] -- true
> [017] +- error: '[string "return test_run:wait_cond(function()         ..."]:1: attempt to
> [017] +    index field ''downstream'' (a nil value)'
> [017]  ...
> [017]  test_run:cmd("switch default")
> [017]  ---
> [017]
> 
> So the wait condition should start from the check of the downstream
> structure availability.
> 
> Follows up #4977
> ---
> 
> Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-4977-test-replication-wal_rw_stress
> Issue: https://github.com/tarantool/tarantool/issues/4977

LGTM.

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

--
Regards, Kirill Yukhin

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

end of thread, other threads:[~2020-07-14 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 10:42 [Tarantool-patches] [PATCH v1] test: replication/wal_rw_stress fix wait_cond Alexander V. Tikhonov
2020-07-14 11:24 ` Kirill Yukhin

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