From 2f43d2901cfd1fb31d11537f5565d44495d95f0c Mon Sep 17 00:00:00 2001 From: WangGuiPing <1243384249@qq.com> Date: Mon, 10 May 2021 13:40:45 +0800 Subject: [PATCH] fix: use newMemoryStorageWithEnts (#258) --- raft/raft_test.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/raft/raft_test.go b/raft/raft_test.go index 6e22e930..d07ebc06 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -502,13 +502,11 @@ func TestOldMessages2AB(t *testing.T) { tt.send(pb.Message{From: 1, To: 1, MsgType: pb.MessageType_MsgPropose, Entries: []*pb.Entry{{Data: []byte("somedata")}}}) ilog := newLog( - &MemoryStorage{ - ents: []pb.Entry{ - {}, {Data: nil, Term: 1, Index: 1}, - {Data: nil, Term: 2, Index: 2}, {Data: nil, Term: 3, Index: 3}, - {Data: []byte("somedata"), Term: 3, Index: 4}, - }, - }) + newMemoryStorageWithEnts([]pb.Entry{ + {}, {Data: nil, Term: 1, Index: 1}, + {Data: nil, Term: 2, Index: 2}, {Data: nil, Term: 3, Index: 3}, + {Data: []byte("somedata"), Term: 3, Index: 4}, + })) ilog.committed = 4 base := ltoa(ilog) for i, p := range tt.peers {