Skip to content

Commit

Permalink
TestLeaderTransferIgnoreProposal
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
  • Loading branch information
tbg committed Sep 20, 2022
1 parent 182e1a3 commit fbe4d40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion raft/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3655,13 +3655,17 @@ func TestLeaderTransferTimeout(t *testing.T) {
}

func TestLeaderTransferIgnoreProposal(t *testing.T) {
nt := newNetwork(nil, nil, nil)
s := newTestMemoryStorage(withPeers(1, 2, 3))
r := newTestRaft(1, 10, 1, s)
nt := newNetwork(r, nil, nil)
nt.send(pb.Message{From: 1, To: 1, Type: pb.MsgHup})

nt.isolate(3)

lead := nt.peers[1].(*raft)

nextEnts(r, s) // handle empty entry

// Transfer leadership to isolated node to let transfer pending, then send proposal.
nt.send(pb.Message{From: 3, To: 1, Type: pb.MsgTransferLeader})
if lead.leadTransferee != 3 {
Expand Down

0 comments on commit fbe4d40

Please sign in to comment.