Browse Source

raft: move defer after run

Xiang Li 11 years ago
parent
commit
ccee264b7d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      raft/node_test.go

+ 1 - 1
raft/node_test.go

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