mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: test logs converge
This commit is contained in:
parent
935320289e
commit
f6f4329899
14
raft_test.go
14
raft_test.go
@ -25,11 +25,23 @@ func TestLeaderElection(t *testing.T) {
|
||||
nil,
|
||||
&stateMachine{log: []Entry{{}, {Term: 1}}},
|
||||
&stateMachine{log: []Entry{{}, {Term: 2}}},
|
||||
&stateMachine{log: []Entry{{}, {Term: 1}}},
|
||||
&stateMachine{log: []Entry{{}, {Term: 1}, {Term: 3}}},
|
||||
nil,
|
||||
),
|
||||
stateFollower,
|
||||
},
|
||||
|
||||
// logs converge
|
||||
{
|
||||
newNetwork(
|
||||
&stateMachine{log: []Entry{{}, {Term: 1}}},
|
||||
nil,
|
||||
&stateMachine{log: []Entry{{}, {Term: 2}}},
|
||||
&stateMachine{log: []Entry{{}, {Term: 1}}},
|
||||
nil,
|
||||
),
|
||||
stateLeader,
|
||||
},
|
||||
}
|
||||
|
||||
for i, tt := range tests {
|
||||
|
Loading…
x
Reference in New Issue
Block a user