Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky raft tests, checking for candidate state #597

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading