Skip to content
Snippets Groups Projects
Commit fc3e6986 authored by Serge Petrenko's avatar Serge Petrenko Committed by Kirill Yukhin
Browse files

replication: fix flaky election_basic test

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)
parent 884e93ad
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment