Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ra_SUITE: Fix flake in consistent_query_leader_change
The line: {ok, 9, B} = ra:consistent_query(B, fun(S) -> S end), would flake because `B` might fail to become the leader. `ra:transfer_leadership/2` is asynchronous and fallible and in cases where the test flaked, `B` was recovering and catching up to the latest changes, so it didn't assume leadership. We can wait for `B` to catch up enough that it should win pre-votes and then wait for it to assume leadership before asserting that `B` is the leader to fix the flake.
- Loading branch information