Explicitly set ip in tests

This commit is contained in:
Leonid Bugaev
2016-04-20 21:44:37 +05:00
parent 4cfa33f89c
commit fa11cc04c8
3 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -15,7 +15,7 @@ func TestHTTPInput(t *testing.T) {
wg := new(sync.WaitGroup)
quit := make(chan int)
input := NewHTTPInput(":0")
input := NewHTTPInput("127.0.0.1:0")
output := NewTestOutput(func(data []byte) {
wg.Done()
})
@@ -48,7 +48,7 @@ func TestInputHTTPLargePayload(t *testing.T) {
log.Fatal("dd error:", err)
}
input := NewHTTPInput(":0")
input := NewHTTPInput("127.0.0.1:0")
output := NewTestOutput(func(data []byte) {
if len(proto.Body(payloadBody(data))) != 4000000 {
t.Error("Should receive full file")
+1 -1
View File
@@ -51,7 +51,7 @@ func BenchmarkTCPInput(b *testing.B) {
wg := new(sync.WaitGroup)
quit := make(chan int)
input := NewTCPInput(":0")
input := NewTCPInput("127.0.0.1:0")
output := NewTestOutput(func(data []byte) {
wg.Done()
})
+1 -1
View File
@@ -35,7 +35,7 @@ func TestTCPOutput(t *testing.T) {
}
func startTCP(cb func([]byte)) net.Listener {
listener, err := net.Listen("tcp", ":0")
listener, err := net.Listen("tcp", "127.0.0.1:0")
if err != nil {
log.Fatal("Can't start:", err)