Browse Source

Merge pull request #6417 from xiang90/fix_TestPipelineExceedMaximumServing

rafthttp: fix TestPipelineExceedMaximumServing
Xiang Li 9 years ago
parent
commit
c350cd7679
1 changed files with 4 additions and 4 deletions
  1. 4 4
      rafthttp/pipeline_test.go

+ 4 - 4
rafthttp/pipeline_test.go

@@ -67,9 +67,9 @@ func TestPipelineKeepSendingWhenPostError(t *testing.T) {
 }
 }
 
 
 func TestPipelineExceedMaximumServing(t *testing.T) {
 func TestPipelineExceedMaximumServing(t *testing.T) {
-	tr := newRoundTripperBlocker()
+	rt := newRoundTripperBlocker()
 	picker := mustNewURLPicker(t, []string{"http://localhost:2380"})
 	picker := mustNewURLPicker(t, []string{"http://localhost:2380"})
-	tp := &Transport{pipelineRt: tr}
+	tp := &Transport{pipelineRt: rt}
 	p := startTestPipeline(tp, picker)
 	p := startTestPipeline(tp, picker)
 	defer p.stop()
 	defer p.stop()
 
 
@@ -91,12 +91,12 @@ func TestPipelineExceedMaximumServing(t *testing.T) {
 	}
 	}
 
 
 	// unblock the senders and force them to send out the data
 	// unblock the senders and force them to send out the data
-	tr.unblock()
+	rt.unblock()
 
 
 	// It could send new data after previous ones succeed
 	// It could send new data after previous ones succeed
 	select {
 	select {
 	case p.msgc <- raftpb.Message{}:
 	case p.msgc <- raftpb.Message{}:
-	case <-time.After(10 * time.Millisecond):
+	case <-time.After(time.Second):
 		t.Errorf("failed to send out message")
 		t.Errorf("failed to send out message")
 	}
 	}
 }
 }