raft: refactor restart test

This commit is contained in:
Xiang Li 2014-09-08 16:10:13 -07:00
parent 54734b0903
commit 19235c8104

View File

@ -51,9 +51,9 @@ func TestNodeRestart(t *testing.T) {
st := raftpb.State{Term: 1, Vote: -1, Commit: 1, LastIndex: 2}
want := Ready{
State: raftpb.State{Term: 1, Vote: -1, Commit: 1, LastIndex: 2},
State: st,
// commit upto index 1
CommittedEntries: []raftpb.Entry{{Term: 1, Index: 1}},
CommittedEntries: entries[:st.Commit],
}
n := Restart(1, []int64{1}, 0, 0, st, entries)