mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #1968 from xiang90/fix_raft_test
raft: flush the commit to fix a race in test
This commit is contained in:
commit
f78bf987c8
@ -451,8 +451,10 @@ func TestCandidateConcede(t *testing.T) {
|
||||
tt.send(pb.Message{From: 3, To: 3, Type: pb.MsgBeat})
|
||||
|
||||
data := []byte("force follower")
|
||||
// send a proposal to 2 to flush out a MsgApp to 0
|
||||
// send a proposal to 3 to flush out a MsgApp to 1
|
||||
tt.send(pb.Message{From: 3, To: 3, Type: pb.MsgProp, Entries: []pb.Entry{{Data: data}}})
|
||||
// send heartbeat; flush out commit
|
||||
tt.send(pb.Message{From: 3, To: 3, Type: pb.MsgBeat})
|
||||
|
||||
a := tt.peers[1].(*raft)
|
||||
if g := a.state; g != StateFollower {
|
||||
|
Loading…
x
Reference in New Issue
Block a user