Tarantool development patches archive
 help / color / mirror / Atom feed
From: "Alexander V. Tikhonov" <avtikhon@tarantool.org>
To: Alexander Turenko <alexander.turenko@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v1] test: replication/status.test.lua fails on Debug
Date: Fri, 11 Sep 2020 22:25:23 +0300	[thread overview]
Message-ID: <367c8ed2adc514b38b884f8082b135ff4f19a7eb.1599852230.git.avtikhon@tarantool.org> (raw)

Found 2 issues on Debug build:

  [009] --- replication/status.result	Fri Sep 11 10:04:53 2020
  [009] +++ replication/status.reject	Fri Sep 11 13:16:21 2020
  [009] @@ -174,7 +174,8 @@
  [009]  ...
  [009]  test_run:wait_downstream(replica_id, {status == 'follow'})
  [009]  ---
  [009] -- true
  [009] +- error: '[string "return test_run:wait_downstream(replica_id, {..."]:1: variable
  [009] +    ''status'' is not declared'
  [009]  ...
  [009]  -- wait for the replication vclock
  [009]  test_run:wait_cond(function()                    \
  [009] @@ -226,7 +227,8 @@
  [009]  ...
  [009]  test_run:wait_upstream(master_id, {status == 'follow'})
  [009]  ---
  [009] -- true
  [009] +- error: '[string "return test_run:wait_upstream(master_id, {sta..."]:1: variable
  [009] +    ''status'' is not declared'
  [009]  ...
  [009]  master.upstream.lag < 1
  [009]  ---

It happened because of the change introduced in commit [1]. Where
mistakenly were used wait_upstream()/wait_downstream() with:

  test_run:wait_*stream(*_id, {status == 'follow'})

with status set using '==' instead of '='. We unable to read status
variable when the strict mode is enabled. It is enabled by default on
Debug builds.

Follows up #5110
Closes #5297

Reviewed-by: Alexander Turenko <alexander.turenko@tarantool.org>
Co-authored-by: Alexander Turenko <alexander.turenko@tarantool.org>

[1] - a08b4f3adc8125794845dc42ac9031d84f9f61f8 ("test: flaky replication/status.test.lua status")
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/gh-5297-fix-status-5110
Issue: https://github.com/tarantool/tarantool/issues/5110
Issue: https://github.com/tarantool/tarantool/issues/5297

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

diff --git a/test/replication/status.result b/test/replication/status.result
index d5addbc80..4f2cf56ea 100644
--- a/test/replication/status.result
+++ b/test/replication/status.result
@@ -172,7 +172,7 @@ replica.upstream == nil
 ---
 - true
 ...
-test_run:wait_downstream(replica_id, {status == 'follow'})
+test_run:wait_downstream(replica_id, {status = 'follow'})
 ---
 - true
 ...
@@ -224,7 +224,7 @@ master.uuid == box.space._cluster:get(master_id)[2]
 ---
 - true
 ...
-test_run:wait_upstream(master_id, {status == 'follow'})
+test_run:wait_upstream(master_id, {status = 'follow'})
 ---
 - true
 ...
diff --git a/test/replication/status.test.lua b/test/replication/status.test.lua
index 6006ce9cf..0facd7c0a 100644
--- a/test/replication/status.test.lua
+++ b/test/replication/status.test.lua
@@ -64,7 +64,7 @@ replica.uuid == box.space._cluster:get(replica_id)[2]
 -- replica.lsn == box.info.vclock[replica_id]
 replica.lsn == 0
 replica.upstream == nil
-test_run:wait_downstream(replica_id, {status == 'follow'})
+test_run:wait_downstream(replica_id, {status = 'follow'})
 -- wait for the replication vclock
 test_run:wait_cond(function()                    \
     local r = box.info.replication[replica_id].downstream.vclock \
@@ -88,7 +88,7 @@ box.info.vclock[master_id] == 2
 master = box.info.replication[master_id]
 master.id == master_id
 master.uuid == box.space._cluster:get(master_id)[2]
-test_run:wait_upstream(master_id, {status == 'follow'})
+test_run:wait_upstream(master_id, {status = 'follow'})
 master.upstream.lag < 1
 master.upstream.idle < 1
 master.upstream.peer:match("unix/")
-- 
2.17.1

             reply	other threads:[~2020-09-11 19:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 19:25 Alexander V. Tikhonov [this message]
2020-09-11 20:28 ` Alexander Turenko

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=367c8ed2adc514b38b884f8082b135ff4f19a7eb.1599852230.git.avtikhon@tarantool.org \
    --to=avtikhon@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1] test: replication/status.test.lua fails on Debug' \
    /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