*: update to use IANA-assigned ports
This commit is contained in:
@ -31,7 +31,7 @@ import (
|
||||
// and increase success count in stats.
|
||||
func TestPipelineSend(t *testing.T) {
|
||||
tr := &roundTripperRecorder{}
|
||||
picker := mustNewURLPicker(t, []string{"http://localhost:7001"})
|
||||
picker := mustNewURLPicker(t, []string{"http://localhost:2380"})
|
||||
fs := &stats.FollowerStats{}
|
||||
p := newPipeline(tr, picker, types.ID(1), types.ID(1), fs, &fakeRaft{}, nil)
|
||||
|
||||
@ -50,7 +50,7 @@ func TestPipelineSend(t *testing.T) {
|
||||
|
||||
func TestPipelineExceedMaximalServing(t *testing.T) {
|
||||
tr := newRoundTripperBlocker()
|
||||
picker := mustNewURLPicker(t, []string{"http://localhost:7001"})
|
||||
picker := mustNewURLPicker(t, []string{"http://localhost:2380"})
|
||||
fs := &stats.FollowerStats{}
|
||||
p := newPipeline(tr, picker, types.ID(1), types.ID(1), fs, &fakeRaft{}, nil)
|
||||
|
||||
@ -90,7 +90,7 @@ func TestPipelineExceedMaximalServing(t *testing.T) {
|
||||
// TestPipelineSendFailed tests that when send func meets the post error,
|
||||
// it increases fail count in stats.
|
||||
func TestPipelineSendFailed(t *testing.T) {
|
||||
picker := mustNewURLPicker(t, []string{"http://localhost:7001"})
|
||||
picker := mustNewURLPicker(t, []string{"http://localhost:2380"})
|
||||
fs := &stats.FollowerStats{}
|
||||
p := newPipeline(newRespRoundTripper(0, errors.New("blah")), picker, types.ID(1), types.ID(1), fs, &fakeRaft{}, nil)
|
||||
|
||||
@ -106,7 +106,7 @@ func TestPipelineSendFailed(t *testing.T) {
|
||||
|
||||
func TestPipelinePost(t *testing.T) {
|
||||
tr := &roundTripperRecorder{}
|
||||
picker := mustNewURLPicker(t, []string{"http://localhost:7001"})
|
||||
picker := mustNewURLPicker(t, []string{"http://localhost:2380"})
|
||||
p := newPipeline(tr, picker, types.ID(1), types.ID(1), nil, &fakeRaft{}, nil)
|
||||
if err := p.post([]byte("some data")); err != nil {
|
||||
t.Fatalf("unexpect post error: %v", err)
|
||||
@ -116,8 +116,8 @@ func TestPipelinePost(t *testing.T) {
|
||||
if g := tr.Request().Method; g != "POST" {
|
||||
t.Errorf("method = %s, want %s", g, "POST")
|
||||
}
|
||||
if g := tr.Request().URL.String(); g != "http://localhost:7001/raft" {
|
||||
t.Errorf("url = %s, want %s", g, "http://localhost:7001/raft")
|
||||
if g := tr.Request().URL.String(); g != "http://localhost:2380/raft" {
|
||||
t.Errorf("url = %s, want %s", g, "http://localhost:2380/raft")
|
||||
}
|
||||
if g := tr.Request().Header.Get("Content-Type"); g != "application/protobuf" {
|
||||
t.Errorf("content type = %s, want %s", g, "application/protobuf")
|
||||
@ -141,10 +141,10 @@ func TestPipelinePostBad(t *testing.T) {
|
||||
err error
|
||||
}{
|
||||
// RoundTrip returns error
|
||||
{"http://localhost:7001", 0, errors.New("blah")},
|
||||
{"http://localhost:2380", 0, errors.New("blah")},
|
||||
// unexpected response status code
|
||||
{"http://localhost:7001", http.StatusOK, nil},
|
||||
{"http://localhost:7001", http.StatusCreated, nil},
|
||||
{"http://localhost:2380", http.StatusOK, nil},
|
||||
{"http://localhost:2380", http.StatusCreated, nil},
|
||||
}
|
||||
for i, tt := range tests {
|
||||
picker := mustNewURLPicker(t, []string{tt.u})
|
||||
@ -164,8 +164,8 @@ func TestPipelinePostErrorc(t *testing.T) {
|
||||
code int
|
||||
err error
|
||||
}{
|
||||
{"http://localhost:7001", http.StatusForbidden, nil},
|
||||
{"http://localhost:7001", http.StatusPreconditionFailed, nil},
|
||||
{"http://localhost:2380", http.StatusForbidden, nil},
|
||||
{"http://localhost:2380", http.StatusPreconditionFailed, nil},
|
||||
}
|
||||
for i, tt := range tests {
|
||||
picker := mustNewURLPicker(t, []string{tt.u})
|
||||
|
Reference in New Issue
Block a user