rafttest: drop isPaused

This commit is contained in:
Xiang Li 2015-02-09 18:52:34 -08:00
parent 085b608de9
commit fa66055f66

View File

@ -12,7 +12,6 @@ import (
type node struct {
raft.Node
id uint64
paused bool
iface iface
stopc chan struct{}
pausec chan bool
@ -67,15 +66,12 @@ func (n *node) start() {
case p := <-n.pausec:
recvms := make([]raftpb.Message, 0)
for p {
// TODO: locking around paused?
n.paused = true
select {
case m := <-n.iface.recv():
recvms = append(recvms, m)
case p = <-n.pausec:
}
}
n.paused = false
// step all pending messages
for _, m := range recvms {
n.Step(context.TODO(), m)
@ -116,7 +112,3 @@ func (n *node) pause() {
func (n *node) resume() {
n.pausec <- false
}
func (n *node) isPaused() bool {
return n.paused
}