mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
listen on localhost:0 instead of :0
MacOS's firewall complains about a previously unknown app trying to listen for network connections whenever we run go test. That's because we *are* listening for network connections on arbitrary interfaces, not just on localhost as we probably intended. Fix that.
This commit is contained in:
parent
436334005e
commit
a6aa1097f1
9 changed files with 12 additions and 12 deletions
|
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
l, err := net.Listen("tcp", ":0")
|
||||
l, err := net.Listen("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const newVal = "newValue"
|
|||
// URL, and returns those. Identical to the copy in /test, except we can't
|
||||
// import that because it imports us.
|
||||
func listenerWithURL() (listener *net.TCPListener, url string, err error) {
|
||||
l, err := net.Listen("tcp", ":0")
|
||||
l, err := net.Listen("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
return listener, url, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ func TestHandlerOptions(t *testing.T) {
|
|||
t.Fatalf("expected error making handler without options, got nil")
|
||||
}
|
||||
|
||||
ln, err := net.Listen("tcp", ":0")
|
||||
ln, err := net.Listen("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
t.Fatalf("creating listener: %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
l, err := net.Listen("tcp", ":0")
|
||||
l, err := net.Listen("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ func TestPQConnect(t *testing.T) {
|
|||
Logger: logger.NopLogger,
|
||||
}
|
||||
|
||||
addr, shutdown, err := pgtest.ServeTCP(":0", server)
|
||||
addr, shutdown, err := pgtest.ServeTCP("localhost:0", server)
|
||||
if err != nil {
|
||||
t.Fatalf("starting postgres server: %v", err)
|
||||
}
|
||||
|
|
@ -129,7 +129,7 @@ func TestPQConnectSSL(t *testing.T) {
|
|||
Logger: logger.NopLogger,
|
||||
}
|
||||
|
||||
addr, shutdown, err := pgtest.ServeTLS(":0", server)
|
||||
addr, shutdown, err := pgtest.ServeTLS("localhost:0", server)
|
||||
if err != nil {
|
||||
t.Fatalf("starting postgres server: %v", err)
|
||||
}
|
||||
|
|
@ -194,7 +194,7 @@ func TestPSQLQuery(t *testing.T) {
|
|||
Logger: logger.NopLogger,
|
||||
}
|
||||
|
||||
addr, shutdown, err := pgtest.ServeTCP(":0", server)
|
||||
addr, shutdown, err := pgtest.ServeTCP("localhost:0", server)
|
||||
if err != nil {
|
||||
t.Fatalf("starting postgres server: %v", err)
|
||||
}
|
||||
|
|
@ -256,7 +256,7 @@ func TestPSQLQuery(t *testing.T) {
|
|||
CancellationManager: pg.NewLocalCancellationManager(rand.Reader),
|
||||
}
|
||||
|
||||
addr, shutdown, err := pgtest.ServeTCP(":0", server)
|
||||
addr, shutdown, err := pgtest.ServeTCP("localhost:0", server)
|
||||
if err != nil {
|
||||
t.Fatalf("starting postgres server: %v", err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -583,7 +583,7 @@ func BenchmarkDbCheckpoint(b *testing.B) {
|
|||
|
||||
// better diagnosis of deadlocks/hung situations versus just really slow "Quick" tests.
|
||||
func TestMain(m *testing.M) {
|
||||
l, err := net.Listen("tcp", ":0")
|
||||
l, err := net.Listen("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ func TestClusterResize_AddNode(t *testing.T) {
|
|||
m1 := test.NewCommandNode(t)
|
||||
lsns := make([]*net.TCPListener, 3)
|
||||
for i := range lsns {
|
||||
l, err := net.Listen("tcp", ":0")
|
||||
l, err := net.Listen("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1043,7 +1043,7 @@ Set("h", adec=100.22)
|
|||
}
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
l, err := net.Listen("tcp", ":0")
|
||||
l, err := net.Listen("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ func (ports *Ports) Close() error {
|
|||
// listenerWithURL builds a TCP listener and corresponding http://localhost:%d
|
||||
// URL, and returns those.
|
||||
func listenerWithURL() (listener *net.TCPListener, url string, err error) {
|
||||
l, err := net.Listen("tcp", ":0")
|
||||
l, err := net.Listen("tcp", "localhost:0")
|
||||
if err != nil {
|
||||
return listener, url, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue