mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: add more assertions for dueling candidates test case
This commit is contained in:
parent
f2b2e0761a
commit
c703ccab63
@ -476,6 +476,16 @@ func TestDuelingCandidates(t *testing.T) {
|
||||
nt.send(pb.Message{From: 1, To: 1, Type: pb.MsgHup})
|
||||
nt.send(pb.Message{From: 3, To: 3, Type: pb.MsgHup})
|
||||
|
||||
sm := nt.peers[1].(*raft)
|
||||
if sm.state != StateLeader {
|
||||
t.Errorf("state = %s, want %s", sm.state, StateLeader)
|
||||
}
|
||||
|
||||
sm = nt.peers[3].(*raft)
|
||||
if sm.state != StateCandidate {
|
||||
t.Errorf("state = %s, want %s", sm.state, StateCandidate)
|
||||
}
|
||||
|
||||
nt.recover()
|
||||
nt.send(pb.Message{From: 3, To: 3, Type: pb.MsgHup})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user