Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Hiltunen <shiltunen@gitlab.com>2020-09-17 20:18:33 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2020-09-17 20:22:32 +0300
commit85879c280f2f02326c3b8c2ed0befe9f8ca9bdf5 (patch)
tree5c0e8566bbcafb88b2d1c48075411efbba673c2a /internal/bootstrap
parent0caad2deff2f830b09176de72fe029f62e6f4da1 (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.go4
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())
}