mirror of
https://github.com/talent-plan/tinykv.git
synced 2025-03-15 04:10:42 +08:00
fix confusing test data (#168)
* change confusing test data * fix word spell
This commit is contained in:
parent
08a4067af7
commit
edb12af93f
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user