Procházet zdrojové kódy

raft/log_test: fixed wrong index

Wine93 před 6 roky
rodič
revize
b0534c1b44
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      raft/log_test.go

+ 1 - 1
raft/log_test.go

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