mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
TestLeaderAcknowledgeCommit
Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
This commit is contained in:
parent
dad8208a4d
commit
36860f863f
@ -473,9 +473,9 @@ func TestLeaderCommitEntry(t *testing.T) {
|
||||
// Reference: section 5.3
|
||||
func TestLeaderAcknowledgeCommit(t *testing.T) {
|
||||
tests := []struct {
|
||||
size int
|
||||
acceptors map[uint64]bool
|
||||
wack bool
|
||||
size int
|
||||
nonLeaderAcceptors map[uint64]bool
|
||||
wack bool
|
||||
}{
|
||||
{1, nil, true},
|
||||
{3, nil, false},
|
||||
@ -496,8 +496,9 @@ func TestLeaderAcknowledgeCommit(t *testing.T) {
|
||||
li := r.raftLog.lastIndex()
|
||||
r.Step(pb.Message{From: 1, To: 1, Type: pb.MsgProp, Entries: []pb.Entry{{Data: []byte("some data")}}})
|
||||
|
||||
tt.nonLeaderAcceptors[1] = true // leader always has the entry
|
||||
for _, m := range r.readMessages() {
|
||||
if tt.acceptors[m.To] {
|
||||
if tt.nonLeaderAcceptors[m.To] {
|
||||
r.Step(acceptAndReply(m))
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user