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/praefect/server_factory_test.go
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/praefect/server_factory_test.go')
-rw-r--r--internal/praefect/server_factory_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/praefect/server_factory_test.go b/internal/praefect/server_factory_test.go
index 158d2c3d4..5c57aaef2 100644
--- a/internal/praefect/server_factory_test.go
+++ b/internal/praefect/server_factory_test.go
@@ -33,7 +33,7 @@ func TestServerFactory(t *testing.T) {
defer gitalyServerFactory.Stop()
// start gitaly serving on public endpoint
- gitalyListener, err := net.Listen(starter.TCP, ":0")
+ gitalyListener, err := net.Listen(starter.TCP, "localhost:0")
require.NoError(t, err)
defer func() { require.NoError(t, gitalyListener.Close()) }()
go gitalyServerFactory.Serve(gitalyListener, false)
@@ -118,7 +118,7 @@ func TestServerFactory(t *testing.T) {
praefectServerFactory := NewServerFactory(conf, logger, coordinator.StreamDirector, nodeMgr, txMgr, queue, rs, registry)
defer praefectServerFactory.Stop()
- listener, err := net.Listen(starter.TCP, ":0")
+ listener, err := net.Listen(starter.TCP, "localhost:0")
require.NoError(t, err)
defer func() { require.NoError(t, listener.Close()) }()
@@ -147,7 +147,7 @@ func TestServerFactory(t *testing.T) {
praefectServerFactory := NewServerFactory(conf, logger, coordinator.StreamDirector, nodeMgr, txMgr, queue, rs, registry)
defer praefectServerFactory.Stop()
- listener, err := net.Listen(starter.TCP, ":0")
+ listener, err := net.Listen(starter.TCP, "localhost:0")
require.NoError(t, err)
defer func() { require.NoError(t, listener.Close()) }()
@@ -187,7 +187,7 @@ func TestServerFactory(t *testing.T) {
defer praefectServerFactory.Stop()
// start with tcp address
- tcpListener, err := net.Listen(starter.TCP, ":0")
+ tcpListener, err := net.Listen(starter.TCP, "localhost:0")
require.NoError(t, err)
defer tcpListener.Close()
@@ -203,7 +203,7 @@ func TestServerFactory(t *testing.T) {
tcpHealthClient := checkOwnRegisteredServices(ctx, t, tcpCC)
// start with tls address
- tlsListener, err := net.Listen(starter.TCP, ":0")
+ tlsListener, err := net.Listen(starter.TCP, "localhost:0")
require.NoError(t, err)
defer tlsListener.Close()