mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 01:41:48 -06:00
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
This commit is contained in:
parent
74cf8fcabd
commit
78d1fc742f
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user