raft/log_test: fixed wrong index

This commit is contained in:
Wine93 2019-08-25 04:47:11 +00:00
parent 5f42161750
commit b0534c1b44

View File

@ -426,7 +426,7 @@ func TestUnstableEnts(t *testing.T) {
ents := raftLog.unstableEntries()
if l := len(ents); l > 0 {
raftLog.stableTo(ents[l-1].Index, ents[l-i].Term)
raftLog.stableTo(ents[l-1].Index, ents[l-1].Term)
}
if !reflect.DeepEqual(ents, tt.wents) {
t.Errorf("#%d: unstableEnts = %+v, want %+v", i, ents, tt.wents)