mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
TestLeaderOnlyCommitsLogFromCurrentTerm
Leader only acks to itself on `(*raft).advance` so we have to make this test a bit more like the real thing. Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
This commit is contained in:
parent
9ff144ef75
commit
7060d75527
@ -894,6 +894,9 @@ func TestLeaderOnlyCommitsLogFromCurrentTerm(t *testing.T) {
|
||||
r.Step(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: []pb.Entry{{}}})
|
||||
|
||||
r.Step(pb.Message{From: 2, To: 1, Type: pb.MsgAppResp, Term: r.Term, Index: tt.index})
|
||||
rd := newReady(r, &SoftState{}, pb.HardState{})
|
||||
storage.Append(rd.Entries)
|
||||
r.advance(rd)
|
||||
if r.raftLog.committed != tt.wcommit {
|
||||
t.Errorf("#%d: commit = %d, want %d", i, r.raftLog.committed, tt.wcommit)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user