Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rafttest: reduce waitLeader flakiness
There are a few tests requiring a stable leader. For example, TestBasicProgress waits for a leader, submits 100 proposals, and expects that all 100 proposals are committed. In rare cases, a leader is elected, and the test proceeds, but in the meantime another node campaigns and wins a higher-term election. After this, some proposals end up not committed (legitimately), and the test fails. This commit modifies the waitLeader function with a better heuristic for a stable leader. It now waits until the leader has the highest term in the cluster, which more reliably (although not 100%) guarantees that there is no in-flight campaign that is about to win. Signed-off-by: Pavel Kalinnikov <[email protected]>
- Loading branch information