TestMsgAppRespWaitReset

Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
This commit is contained in:
Tobias Grieger 2022-09-06 12:25:52 +02:00
parent ff837f3a0b
commit b462fd15c2

View File

@ -1424,14 +1424,14 @@ func TestRaftFreesReadOnlyMem(t *testing.T) {
// TestMsgAppRespWaitReset verifies the resume behavior of a leader // TestMsgAppRespWaitReset verifies the resume behavior of a leader
// MsgAppResp. // MsgAppResp.
func TestMsgAppRespWaitReset(t *testing.T) { func TestMsgAppRespWaitReset(t *testing.T) {
sm := newTestRaft(1, 5, 1, newTestMemoryStorage(withPeers(1, 2, 3))) s := newTestMemoryStorage(withPeers(1, 2, 3))
sm := newTestRaft(1, 5, 1, s)
sm.becomeCandidate() sm.becomeCandidate()
sm.becomeLeader() sm.becomeLeader()
// The new leader has just emitted a new Term 4 entry; consume those messages // Run n1 which includes sending a message like the below
// from the outgoing queue. // one to n2, but also appending to its own log.
sm.bcastAppend() nextEnts(sm, s)
sm.readMessages()
// Node 2 acks the first entry, making it committed. // Node 2 acks the first entry, making it committed.
sm.Step(pb.Message{ sm.Step(pb.Message{