diff --git a/plugins/common/proxy/socks5_test.go b/plugins/common/proxy/socks5_test.go index 33fa4b4aab724..5cd26d4106cc8 100644 --- a/plugins/common/proxy/socks5_test.go +++ b/plugins/common/proxy/socks5_test.go @@ -15,7 +15,7 @@ func TestSocks5ProxyConfigIntegration(t *testing.T) { } const ( - proxyAddress = "0.0.0.0:12345" + proxyAddress = "127.0.0.1:12345" proxyUsername = "user" proxyPassword = "password" ) diff --git a/plugins/inputs/kafka_consumer/kafka_consumer_test.go b/plugins/inputs/kafka_consumer/kafka_consumer_test.go index baa1317ea1e06..14f3e4da3cdac 100644 --- a/plugins/inputs/kafka_consumer/kafka_consumer_test.go +++ b/plugins/inputs/kafka_consumer/kafka_consumer_test.go @@ -592,7 +592,7 @@ func TestExponentialBackoff(t *testing.T) { max := 3 // get an unused port by listening on next available port, then closing it - listener, err := net.Listen("tcp", ":0") + listener, err := net.Listen("tcp", "127.0.0.1:0") require.NoError(t, err) port := listener.Addr().(*net.TCPAddr).Port require.NoError(t, listener.Close()) diff --git a/plugins/inputs/x509_cert/x509_cert_test.go b/plugins/inputs/x509_cert/x509_cert_test.go index 37d1ea13c545e..cd174a6098cb3 100644 --- a/plugins/inputs/x509_cert/x509_cert_test.go +++ b/plugins/inputs/x509_cert/x509_cert_test.go @@ -83,7 +83,7 @@ func TestGatherRemoteIntegration(t *testing.T) { } } - ln, err := tls.Listen("tcp", ":0", cfg) + ln, err := tls.Listen("tcp", "127.0.0.1:0", cfg) require.NoError(t, err) defer ln.Close()