From ff9d16a2e0bcfb20cc847af33cb0fbae9a00dd7d Mon Sep 17 00:00:00 2001 From: "swingbach@gmail.com" Date: Fri, 20 May 2016 14:04:08 +0800 Subject: [PATCH] raft: fix tiny mistake of message type --- raft/raft_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raft/raft_test.go b/raft/raft_test.go index 660e14214..daf6c425e 100644 --- a/raft/raft_test.go +++ b/raft/raft_test.go @@ -873,8 +873,8 @@ func TestHandleHeartbeat(t *testing.T) { m pb.Message wCommit uint64 }{ - {pb.Message{From: 2, To: 1, Type: pb.MsgApp, Term: 2, Commit: commit + 1}, commit + 1}, - {pb.Message{From: 2, To: 1, Type: pb.MsgApp, Term: 2, Commit: commit - 1}, commit}, // do not decrease commit + {pb.Message{From: 2, To: 1, Type: pb.MsgHeartbeat, Term: 2, Commit: commit + 1}, commit + 1}, + {pb.Message{From: 2, To: 1, Type: pb.MsgHeartbeat, Term: 2, Commit: commit - 1}, commit}, // do not decrease commit } for i, tt := range tests {