Преглед изворни кода

raft: refactor restart test

Xiang Li пре 11 година
родитељ
комит
19235c8104
1 измењених фајлова са 2 додато и 2 уклоњено
  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)