etcd-io / raft

Raft library for maintaining a replicated state machine
Apache License 2.0
666 stars 164 forks source link

Improve testing around TestCandidateSelfVoteAfterWonElection #127

Open nvanbenschoten opened 9 months ago

nvanbenschoten commented 9 months ago

This commit improves the testing around cases where a (pre-)candidate wins an election without having voted for themselves. This was already tested by TestCandidateDeliversPreCandidateSelfVoteAfterBecomingCandidate, but this commit expands the testing to handle three related cases and to mirror the existing TestCandidateSelfVoteAfterLostElection test.

cc. @pav-kv

nvanbenschoten commented 9 months ago

@pav-kv when you get a chance, want to give this testing PR a pass?

ahrtr commented 9 months ago

Overall looks good to me. Just a couple of minor comments.