raft: move defer after run

This commit is contained in:
Xiang Li 2014-09-12 12:28:15 -07:00
parent 45f56a5377
commit ccee264b7d

View File

@ -87,9 +87,9 @@ func TestNodeStepUnblock(t *testing.T) {
// who is the current leader.
func TestBlockProposal(t *testing.T) {
n := newNode()
defer n.Stop()
r := newRaft(1, []int64{1}, 10, 1)
go n.run(r)
defer n.Stop()
errc := make(chan error, 1)
go func() {