TestLeaderTransferIgnoreProposal

Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
This commit is contained in:
Tobias Grieger 2022-09-06 12:57:44 +02:00
parent 182e1a371d
commit fbe4d40086

View File

@ -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 {