From fa11cc04c8d5a9d6950fe1350fe1aaa305588f1e Mon Sep 17 00:00:00 2001 From: Leonid Bugaev Date: Wed, 20 Apr 2016 21:44:37 +0500 Subject: [PATCH] Explicitly set ip in tests --- input_http_test.go | 4 ++-- input_tcp_test.go | 2 +- output_tcp_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/input_http_test.go b/input_http_test.go index 6d1d64c..733e300 100644 --- a/input_http_test.go +++ b/input_http_test.go @@ -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") diff --git a/input_tcp_test.go b/input_tcp_test.go index 9d88682..21f585e 100644 --- a/input_tcp_test.go +++ b/input_tcp_test.go @@ -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() }) diff --git a/output_tcp_test.go b/output_tcp_test.go index b295d7a..a7efd38 100644 --- a/output_tcp_test.go +++ b/output_tcp_test.go @@ -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)