fix confusing test data (#168)

* change confusing test data

* fix word spell
This commit is contained in:
xiongjiwei 2020-05-11 17:19:26 +08:00 committed by GitHub
parent 08a4067af7
commit edb12af93f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ const (
MsgTypeStart MsgType = 1
// message of base tick to drive the ticker
MsgTypeTick MsgType = 2
// message wraps a raft message that should be forwardded to Raft module
// message wraps a raft message that should be forwarded to Raft module
// the raft message is from peer on other store
MsgTypeRaftMessage MsgType = 3
// message warps a raft command that maybe a read/write request or admin request

View File

@ -551,8 +551,8 @@ func TestHandleMessageType_MsgAppend2AB(t *testing.T) {
{pb.Message{MsgType: pb.MessageType_MsgAppend, Term: 2, LogTerm: 1, Index: 1, Commit: 4, Entries: []*pb.Entry{{Index: 2, Term: 2}}}, 2, 2, false},
// Ensure 3
{pb.Message{MsgType: pb.MessageType_MsgAppend, Term: 1, LogTerm: 1, Index: 1, Commit: 3}, 2, 1, false}, // match entry 1, commit up to last new entry 1
{pb.Message{MsgType: pb.MessageType_MsgAppend, Term: 1, LogTerm: 1, Index: 1, Commit: 3, Entries: []*pb.Entry{{Index: 2, Term: 2}}}, 2, 2, false}, // match entry 1, commit up to last new entry 2
{pb.Message{MsgType: pb.MessageType_MsgAppend, Term: 2, LogTerm: 1, Index: 1, Commit: 3}, 2, 1, false}, // match entry 1, commit up to last new entry 1
{pb.Message{MsgType: pb.MessageType_MsgAppend, Term: 2, LogTerm: 1, Index: 1, Commit: 3, Entries: []*pb.Entry{{Index: 2, Term: 2}}}, 2, 2, false}, // match entry 1, commit up to last new entry 2
{pb.Message{MsgType: pb.MessageType_MsgAppend, Term: 2, LogTerm: 2, Index: 2, Commit: 3}, 2, 2, false}, // match entry 2, commit up to last new entry 2
{pb.Message{MsgType: pb.MessageType_MsgAppend, Term: 2, LogTerm: 2, Index: 2, Commit: 4}, 2, 2, false}, // commit up to log.last()
}
@ -738,7 +738,7 @@ func TestAllServerStepdown2AB(t *testing.T) {
wlead = None
}
if sm.Lead != wlead {
t.Errorf("#%d, sm.Lead = %d, want %d", i, sm.Lead, None)
t.Errorf("#%d, sm.Lead = %d, want %d", i, sm.Lead, wlead)
}
}
}