diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2020-09-17 20:18:33 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2020-09-17 20:22:32 +0300 |
commit | 85879c280f2f02326c3b8c2ed0befe9f8ca9bdf5 (patch) | |
tree | 5c0e8566bbcafb88b2d1c48075411efbba673c2a /internal/bootstrap | |
parent | 0caad2deff2f830b09176de72fe029f62e6f4da1 (diff) |
listen on localhost in tests
Various tests are binding to other IP addresses than localhost.
Ideally the tests should not open public sockets during the test run.
Additionally, this causes macOS firewall to ask for permission on each
test run.
Diffstat (limited to 'internal/bootstrap')
-rw-r--r-- | internal/bootstrap/bootstrap_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/bootstrap/bootstrap_test.go b/internal/bootstrap/bootstrap_test.go index 36be95673..de824fc2b 100644 --- a/internal/bootstrap/bootstrap_test.go +++ b/internal/bootstrap/bootstrap_test.go @@ -204,14 +204,14 @@ func TestPortReuse(t *testing.T) { b, err := New() require.NoError(t, err) - l, err := b.listen("tcp", "0.0.0.0:") + l, err := b.listen("tcp", "localhost:") require.NoError(t, err, "failed to bind") addr = l.Addr().String() _, port, err := net.SplitHostPort(addr) require.NoError(t, err) - l, err = b.listen("tcp", "0.0.0.0:"+port) + l, err = b.listen("tcp", "localhost:"+port) require.NoError(t, err, "failed to bind") require.NoError(t, l.Close()) } |