Tarantool development patches archive
 help / color / mirror / Atom feed
From: Serge Petrenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: v.ioffe@tarantool.org, kyukhin@tarantool.org
Cc: tarantool-patches@dev.tarantool.org
Subject: [Tarantool-patches] [PATCH v2 2/2] replication: fix flaky election_basic test
Date: Mon, 16 Aug 2021 18:15:23 +0300	[thread overview]
Message-ID: <d5acddd1b92e87e4068ca301e8990c51a2fa2b4f.1629126742.git.sergepetrenko@tarantool.org> (raw)
In-Reply-To: <cover.1629126742.git.sergepetrenko@tarantool.org>

Found the following error in our CI:

 Test failed! Result content mismatch:
 --- replication/election_basic.result	Fri Aug 13 13:50:26 2021
 +++ /build/usr/src/debug/tarantool-2.9.0.276/test/var/rejects/replication/election_basic.reject	Sat Aug 14 08:14:17 2021
 @@ -116,6 +116,7 @@
   | ...
  box.ctl.demote()
   | ---
 + | - error: box.ctl.demote does not support simultaneous invocations
   | ...
  --

Even though box.ctl.demote() or box.ctl.promote() isn't called above the
failing line, promote() is issued internally once the instance becomes
the leader.

Wait until previous promote is finished
(i.e. box.info.synchro.queue.owner is set)
---
 test/replication/election_basic.result   | 6 ++++++
 test/replication/election_basic.test.lua | 3 +++
 2 files changed, 9 insertions(+)

diff --git a/test/replication/election_basic.result b/test/replication/election_basic.result
index 5da57e87d..382aeef60 100644
--- a/test/replication/election_basic.result
+++ b/test/replication/election_basic.result
@@ -95,6 +95,12 @@ test_run:wait_cond(function() return box.info.election.state == 'leader' end)
  | ---
  | - true
  | ...
+test_run:wait_cond(function()\
+    return box.info.synchro.queue.owner == box.info.id\
+end)
+ | ---
+ | - true
+ | ...
 assert(box.info.election.term > term)
  | ---
  | - true
diff --git a/test/replication/election_basic.test.lua b/test/replication/election_basic.test.lua
index 3b3a3e7e5..47f3d318e 100644
--- a/test/replication/election_basic.test.lua
+++ b/test/replication/election_basic.test.lua
@@ -35,6 +35,9 @@ assert(box.info.election.leader == 0)
 box.cfg{election_timeout = 1000}
 box.cfg{election_mode = 'candidate'}
 test_run:wait_cond(function() return box.info.election.state == 'leader' end)
+test_run:wait_cond(function()\
+    return box.info.synchro.queue.owner == box.info.id\
+end)
 assert(box.info.election.term > term)
 assert(box.info.election.vote == box.info.id)
 assert(box.info.election.leader == box.info.id)
-- 
2.30.1 (Apple Git-130)


  parent reply	other threads:[~2021-08-16 15:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 15:15 [Tarantool-patches] [PATCH v2 0/2] fix a couple of flaky tests Serge Petrenko via Tarantool-patches
2021-08-16 15:15 ` [Tarantool-patches] [PATCH v2 1/2] applier: fix upstream.lag calculations Serge Petrenko via Tarantool-patches
2021-08-16 16:25   ` Vitaliia Ioffe via Tarantool-patches
2021-08-16 15:15 ` Serge Petrenko via Tarantool-patches [this message]
2021-08-17  7:21 ` [Tarantool-patches] [PATCH v2 0/2] fix a couple of flaky tests Kirill Yukhin via Tarantool-patches

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=d5acddd1b92e87e4068ca301e8990c51a2fa2b4f.1629126742.git.sergepetrenko@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=kyukhin@tarantool.org \
    --cc=sergepetrenko@tarantool.org \
    --cc=v.ioffe@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 2/2] replication: fix flaky election_basic test' \
    /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