Skip to content
Snippets Groups Projects
user avatar
Serge Petrenko authored
The test failed with the following output:

 TAP version 13
 1..3
 # Started on Tue Jun 28 13:36:03 2022
 # Starting group: pre-vote
 not ok 1	pre-vote.test_no_direct_connection
 #   .../election_pre_vote_test.lua:46: expected: a value evaluating to
					true, actual: false
 #   stack traceback:
 #   .../election_pre_vote_test.lua:65: in function 'retrying'
 #   .../election_pre_vote_test.lua:64: in function
				    'pre-vote.test_no_direct_connection'
 #   ...
 #   [C]: in function 'xpcall'
 ok     2	pre-vote.test_no_quorum
 ok     3	pre-vote.test_promote_no_quorum
 # Ran 3 tests in 6.994 seconds, 2 succeeded, 1 failed

This is the moment when one of the followers disconnects from
the leader and expects its `box.info.election.leader_idle` to grow.

It wasn't taken into account that this disconnect might lead to leader
resign due to fencing, and then a new leader would emerge and
`leader_idle` would still be small.

IOW, the leader starts with fencing turned off, and only resumes
fencing, once it has connected to a quorum of nodes (one replica in this
test). If the replica that we just connected happens to be the one we
disconnect in the test, the leader might fence, if it hasn't yet
connected to the other replica, because it immediately loses a quorum of
healthy connections right after gaining it for the first time.

Fix this by waiting until everyone follows everyone before each test
case.

The test, of course, could be fixed by turning fencing off, but this
might hide any possible future problems with fencing.

Follow-up #6654
Follow-up #6661

NO_CHANGELOG=test fix
NO_DOC=test fix
a10958e2
History
Name Last commit Last update