From 78d1fc742f728b4a38e4044a1d1625f63c46cb14 Mon Sep 17 00:00:00 2001 From: Emil Hessman Date: Tue, 27 Jan 2015 15:12:37 +0100 Subject: [PATCH] config/module: adjust HttpGetter test to fix Windows test failure Specify laddr on the form host:port in the call to net.Listen as documented for net.Dial, see godoc.org/net#Dial Fixes the following test failures on Windows: > go test -run=TestHttpGetter --- FAIL: TestHttpGetter_header (0.00s) get_http_test.go:31: err: Get http://[::]:52101/header?terraform-get=1: dial tcp [::]:52101: ConnectEx tcp: The requested address is not valid in its context. --- FAIL: TestHttpGetter_meta (0.00s) get_http_test.go:55: err: Get http://[::]:52103/meta?terraform-get=1: dial tcp [::]:52103: ConnectEx tcp: The requested address is not valid in its context. --- FAIL: TestHttpGetter_metaSubdir (0.00s) get_http_test.go:79: err: Get http://[::]:52105/meta-subdir?terraform-get=1: dial tcp [::]:52105: ConnectEx tcp: The requested address is not valid in its context. FAIL exit status 1 FAIL github.com/hashicorp/terraform/config/module 0.054s --- config/module/get_http_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/module/get_http_test.go b/config/module/get_http_test.go index 5eb83a619..5f2590f48 100644 --- a/config/module/get_http_test.go +++ b/config/module/get_http_test.go @@ -105,7 +105,7 @@ func TestHttpGetter_none(t *testing.T) { } func testHttpServer(t *testing.T) net.Listener { - ln, err := net.Listen("tcp", ":0") + ln, err := net.Listen("tcp", "127.0.0.1:0") if err != nil { t.Fatalf("err: %s", err) }