Browse Source

raft: refactor restart test

Xiang Li 11 years ago
parent
commit
19235c8104
1 changed files with 2 additions and 2 deletions
  1. 2 2
      raft/node_test.go

+ 2 - 2
raft/node_test.go

@@ -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)