Skip to content
Snippets Groups Projects
Commit 5105c2d7 authored by Vladislav Shpilevoy's avatar Vladislav Shpilevoy Committed by Vladimir Davydov
Browse files

test: fix flaky read_only_reason test

The test sometimes failed the test cases
test_read_only_reason_synchro_no_uuid and
test_read_only_reason_election_has_leader_no_uuid.

Both relied on an instance being gone from 'replicaset' global
internal object in C once it is gone from _cluster. But it wasn't
true.

If an instance is not visible in _cluster, it could still be not
deleted from 'replicaset' because it is done only on WAL write
end. So this was a dirty read - the check about an id absent in
_cluster.

The more reliable way is to check that the replica is gone from
box.info.replication - it is built from this 'replicaset' object.

Closes #6621
parent ec937bee
No related branches found
No related tags found
No related merge requests found
......@@ -261,7 +261,7 @@ g.test_read_only_reason_election_has_leader_no_uuid = function(g)
t.helpers.retrying({}, function()
assert(g.replica:exec(function(leader_id)
return box.space._cluster:get{leader_id} == nil
return box.info.replication[leader_id] == nil
end, {leader_id}))
end)
......@@ -301,7 +301,7 @@ g.test_read_only_reason_synchro_no_uuid = function(g)
t.helpers.retrying({}, function()
assert(g.replica:exec(function(leader_id)
return box.info.synchro.queue.owner ~= 0 and
box.space._cluster:get{leader_id} == nil
box.info.replication[leader_id] == nil
end, {leader_id}))
end)
......
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