TestNodeProposeWaitDropped

The test just needs to ignore the MsgAppResp.

Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
This commit is contained in:
Tobias Grieger 2022-09-06 09:13:46 +02:00
parent 1a81b27bed
commit 873cdf3fa6

View File

@ -479,6 +479,10 @@ func TestNodeProposeWaitDropped(t *testing.T) {
t.Logf("dropping message: %v", m.String())
return ErrProposalDropped
}
if m.Type == raftpb.MsgAppResp {
// This is produced by raft internally, see (*raft).advance.
return nil
}
msgs = append(msgs, m)
return nil
}
@ -511,7 +515,7 @@ func TestNodeProposeWaitDropped(t *testing.T) {
n.Stop()
if len(msgs) != 0 {
t.Fatalf("len(msgs) = %d, want %d", len(msgs), 1)
t.Fatalf("len(msgs) = %d, want %d", len(msgs), 0)
}
}