Skip to content

Commit

Permalink
correct some raft test errors
Browse files Browse the repository at this point in the history
Signed-off-by: kikimo <[email protected]>
  • Loading branch information
kikimo committed Jun 10, 2023
1 parent a042ce3 commit f0d45dd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4355,9 +4355,7 @@ func TestPreVoteMigrationCanCompleteElection(t *testing.T) {
nt.send(pb.Message{From: 2, To: 2, Type: pb.MsgHup})

// Do we have a leader?
if n2.state != StateLeader && n3.state != StateFollower {
t.Errorf("no leader")
}
require.False(t, n2.state != StateLeader && n3.state != StateLeader, "no leader");
}

func TestPreVoteMigrationWithFreeStuckPreCandidate(t *testing.T) {
Expand Down Expand Up @@ -4787,7 +4785,7 @@ func TestFastLogRejection(t *testing.T) {
require.Equal(t, test.rejectHintTerm, msgs[0].LogTerm, "hint log term mismatch")
require.Equal(t, test.rejectHintIndex, msgs[0].RejectHint, "hint log index mismatch")

require.NoError(t, n1.Step(msgs[0]), "peer 1 step append fail")
require.NoError(t, n1.Step(msgs[0]), "peer 1 step append response fail")
msgs = n1.readMessages()
require.Equal(t, test.nextAppendTerm, msgs[0].LogTerm)
require.Equal(t, test.nextAppendIndex, msgs[0].Index)
Expand Down

0 comments on commit f0d45dd

Please sign in to comment.