mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
raft: fix promotable
This commit is contained in:
@@ -13,8 +13,7 @@ const (
|
||||
func TestTickMsgHup(t *testing.T) {
|
||||
n := New(0, defaultHeartbeat, defaultElection)
|
||||
n.sm = newStateMachine(0, []int64{0, 1, 2})
|
||||
// simulate to patch the join log
|
||||
n.Step(Message{From: 1, Type: msgApp, Commit: 1, Entries: []Entry{Entry{}}})
|
||||
n.sm.promotable = true
|
||||
|
||||
for i := 0; i < defaultElection*2; i++ {
|
||||
n.Tick()
|
||||
@@ -80,6 +79,7 @@ func TestResetElapse(t *testing.T) {
|
||||
for i, tt := range tests {
|
||||
n := New(0, defaultHeartbeat, defaultElection)
|
||||
n.sm = newStateMachine(0, []int64{0, 1, 2})
|
||||
n.sm.promotable = true
|
||||
n.sm.raftLog.append(0, Entry{Type: Normal, Term: 1})
|
||||
n.sm.term = 2
|
||||
n.sm.raftLog.committed = 1
|
||||
|
||||
Reference in New Issue
Block a user