Skip to content

Commit

Permalink
do not check for candidate state as it's a transient state (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhiaayachi authored Jun 6, 2024
1 parent 181475c commit d5f5737
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2959,7 +2959,6 @@ func TestRaft_VoteNotGranted_WhenNodeNotInCluster(t *testing.T) {

// wait for the remaining follower to trigger an election
waitForState(follower, Candidate)
require.Equal(t, Candidate, follower.getState())

// send a vote request from the removed follower to the Candidate follower
if err := followerRemovedT.RequestVote(follower.localID, follower.localAddr, &reqVote, &resp); err != nil {
Expand Down Expand Up @@ -3161,9 +3160,8 @@ func TestRaft_VoteWithNoIDNoAddr(t *testing.T) {

// wait for the remaining follower to trigger an election
waitForState(follower, Candidate)
require.Equal(t, Candidate, follower.getState())
// send a vote request from the removed follower to the Candidate follower

// send a vote request from the removed follower to the Candidate follower
if err := followerT.RequestVote(follower.localID, follower.localAddr, &reqVote, &resp); err != nil {
t.Fatalf("RequestVote RPC failed %v", err)
}
Expand Down

0 comments on commit d5f5737

Please sign in to comment.