From 8e5dccc9b2adae1f6f98a54709bba5f24f454246 Mon Sep 17 00:00:00 2001 From: Vladimir Skipor Date: Sun, 1 Oct 2017 20:29:31 +0300 Subject: [PATCH] Fix failing LookupReachable travis tests --- components/phttp/import/import_suite_test.go | 4 ++-- lib/netutil/netutil_suite_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/phttp/import/import_suite_test.go b/components/phttp/import/import_suite_test.go index b8432e4c2..0c7f0f60d 100644 --- a/components/phttp/import/import_suite_test.go +++ b/components/phttp/import/import_suite_test.go @@ -30,13 +30,13 @@ var _ = Describe("preResolveTargetAddr", func() { conf := &ClientConfig{} conf.Dialer.DNSCache = true - listener, err := net.ListenTCP("tcp6", nil) + listener, err := net.ListenTCP("tcp4", nil) defer listener.Close() Expect(err).NotTo(HaveOccurred()) port := strconv.Itoa(listener.Addr().(*net.TCPAddr).Port) target := "localhost:" + port - expectedResolved := "[::1]:" + port + expectedResolved := "127.0.0.1:" + port err = preResolveTargetAddr(conf, &target) Expect(err).NotTo(HaveOccurred()) diff --git a/lib/netutil/netutil_suite_test.go b/lib/netutil/netutil_suite_test.go index 462bb073c..f36a31599 100644 --- a/lib/netutil/netutil_suite_test.go +++ b/lib/netutil/netutil_suite_test.go @@ -21,13 +21,13 @@ func TestNetutil(t *testing.T) { var _ = Describe("DNS", func() { It("lookup reachable", func() { - listener, err := net.ListenTCP("tcp6", nil) + listener, err := net.ListenTCP("tcp4", nil) defer listener.Close() Expect(err).NotTo(HaveOccurred()) port := strconv.Itoa(listener.Addr().(*net.TCPAddr).Port) addr := "localhost:" + port - expectedResolved := "[::1]:" + port + expectedResolved := "127.0.0.1:" + port resolved, err := LookupReachable(addr) Expect(err).NotTo(HaveOccurred())