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:
authorAndrew Newdigate <andrew@gitlab.com>2018-11-15 20:50:53 +0300
committerAndrew Newdigate <andrew@gitlab.com>2018-11-15 22:02:48 +0300
commit57b61a9dd678364f36fb3b29f382e6fb0172349b (patch)
tree2da7aff0185a64823e84f46de0e5fad727cd2ea2
parent32d6a702c348007dc52aa8f9c5620ab77e66c852 (diff)
Attempting to resolve issues with GRPC upgradean-attempted-grpc-fix
-rw-r--r--client/dial.go13
-rw-r--r--internal/middleware/limithandler/limithandler_test.go5
-rw-r--r--internal/rubyserver/health.go4
-rw-r--r--internal/rubyserver/rubyserver.go11
-rw-r--r--internal/server/auth_test.go7
-rw-r--r--internal/service/blob/testhelper_test.go6
-rw-r--r--internal/service/commit/testhelper_test.go6
-rw-r--r--internal/service/conflicts/resolve_conflicts_test.go2
-rw-r--r--internal/service/conflicts/testhelper_test.go6
-rw-r--r--internal/service/diff/testhelper_test.go6
-rw-r--r--internal/service/namespace/testhelper_test.go6
-rw-r--r--internal/service/operations/cherry_pick_test.go2
-rw-r--r--internal/service/operations/testhelper_test.go6
-rw-r--r--internal/service/ref/testhelper_test.go6
-rw-r--r--internal/service/remote/fetch_internal_remote_test.go2
-rw-r--r--internal/service/remote/testhelper_test.go6
-rw-r--r--internal/service/repository/fetch_test.go6
-rw-r--r--internal/service/repository/testhelper_test.go5
-rw-r--r--internal/service/server/info_test.go6
-rw-r--r--internal/service/smarthttp/testhelper_test.go6
-rw-r--r--internal/service/ssh/receive_pack_test.go2
-rw-r--r--internal/service/ssh/testhelper_test.go6
-rw-r--r--internal/service/ssh/upload_archive_test.go2
-rw-r--r--internal/service/ssh/upload_pack_test.go2
-rw-r--r--internal/service/storage/testhelper_test.go6
-rw-r--r--internal/service/wiki/testhelper_test.go6
-rw-r--r--internal/testhelper/testhelper.go2
27 files changed, 29 insertions, 114 deletions
diff --git a/client/dial.go b/client/dial.go
index 89f2a10b0..6037775b6 100644
--- a/client/dial.go
+++ b/client/dial.go
@@ -2,10 +2,8 @@ package client
import (
"fmt"
- "net"
"net/url"
"strings"
- "time"
"google.golang.org/grpc"
)
@@ -17,16 +15,7 @@ var DefaultDialOpts = []grpc.DialOption{
// Dial gitaly
func Dial(rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, error) {
- network, addr, err := parseAddress(rawAddress)
- if err != nil {
- return nil, err
- }
-
- connOpts = append(connOpts,
- grpc.WithDialer(func(a string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout(network, a, timeout)
- }))
- conn, err := grpc.Dial(addr, connOpts...)
+ conn, err := grpc.Dial(rawAddress, connOpts...)
if err != nil {
return nil, err
}
diff --git a/internal/middleware/limithandler/limithandler_test.go b/internal/middleware/limithandler/limithandler_test.go
index ee5e24b10..4a6e6ffc8 100644
--- a/internal/middleware/limithandler/limithandler_test.go
+++ b/internal/middleware/limithandler/limithandler_test.go
@@ -207,15 +207,12 @@ func runServer(t *testing.T, s *server, opt ...grpc.ServerOption) (*grpc.Server,
go grpcServer.Serve(lis)
- return grpcServer, serverSocketPath
+ return grpcServer, "unix://" + serverSocketPath
}
func newClient(t *testing.T, serverSocketPath string) (pb.TestClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/rubyserver/health.go b/internal/rubyserver/health.go
index fd7b32747..10550d7dc 100644
--- a/internal/rubyserver/health.go
+++ b/internal/rubyserver/health.go
@@ -1,7 +1,6 @@
package rubyserver
import (
- "net"
"time"
"golang.org/x/net/context"
@@ -13,9 +12,6 @@ func ping(address string) error {
conn, err := grpc.Dial(
address,
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
)
if err != nil {
return err
diff --git a/internal/rubyserver/rubyserver.go b/internal/rubyserver/rubyserver.go
index 3fdfc31f7..99cb290a5 100644
--- a/internal/rubyserver/rubyserver.go
+++ b/internal/rubyserver/rubyserver.go
@@ -3,7 +3,6 @@ package rubyserver
import (
"fmt"
"io/ioutil"
- "net"
"os"
"path"
"path/filepath"
@@ -126,6 +125,7 @@ func Start() (*Server, error) {
for i := 0; i < numWorkers; i++ {
name := fmt.Sprintf("gitaly-ruby.%d", i)
socketPath := socketPath(i)
+ address := "unix://" + socketPath
// Use 'ruby-cd' to make sure gitaly-ruby has the same working directory
// as the current process. This is a hack to sort-of support relative
@@ -133,13 +133,13 @@ func Start() (*Server, error) {
args := []string{"bundle", "exec", "bin/ruby-cd", wd, gitalyRuby, strconv.Itoa(os.Getpid()), socketPath}
events := make(chan supervisor.Event)
- check := func() error { return ping(socketPath) }
+ check := func() error { return ping(address) }
p, err := supervisor.New(name, env, args, cfg.Ruby.Dir, cfg.Ruby.MaxRSS, events, check)
if err != nil {
return nil, err
}
- s.workers = append(s.workers, newWorker(p, socketPath, events, false))
+ s.workers = append(s.workers, newWorker(p, address, events, false))
}
return s, nil
@@ -240,7 +240,7 @@ func (s *Server) createConnection(ctx context.Context) (*grpc.ClientConn, error)
dialCtx, cancel := context.WithTimeout(ctx, ConnectTimeout)
defer cancel()
- conn, err := grpc.DialContext(dialCtx, balancer.Scheme+"://gitaly-ruby", dialOptions()...)
+ conn, err := grpc.DialContext(dialCtx, balancer.Scheme+":///gitaly-ruby", dialOptions()...)
if err != nil {
return nil, err
}
@@ -253,9 +253,6 @@ func dialOptions() []grpc.DialOption {
return []grpc.DialOption{
grpc.WithBlock(), // With this we get retries. Without, connections fail fast.
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
grpc.WithUnaryInterceptor(grpc_prometheus.UnaryClientInterceptor),
grpc.WithStreamInterceptor(grpc_prometheus.StreamClientInterceptor),
}
diff --git a/internal/server/auth_test.go b/internal/server/auth_test.go
index b50445a84..be711ac3b 100644
--- a/internal/server/auth_test.go
+++ b/internal/server/auth_test.go
@@ -3,7 +3,6 @@ package server
import (
"net"
"testing"
- "time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -146,10 +145,6 @@ func (brokenAuth) GetRequestMetadata(netctx.Context, ...string) (map[string]stri
}
func dial(serverSocketPath string, opts []grpc.DialOption) (*grpc.ClientConn, error) {
- opts = append(opts, grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }))
-
return grpc.Dial(serverSocketPath, opts...)
}
@@ -171,5 +166,5 @@ func runServer(t *testing.T) (*grpc.Server, string) {
require.NoError(t, err)
go srv.Serve(listener)
- return srv, serverSocketPath
+ return srv, "unix://" + serverSocketPath
}
diff --git a/internal/service/blob/testhelper_test.go b/internal/service/blob/testhelper_test.go
index 19a7bc534..95cc08caf 100644
--- a/internal/service/blob/testhelper_test.go
+++ b/internal/service/blob/testhelper_test.go
@@ -5,7 +5,6 @@ import (
"net"
"os"
"testing"
- "time"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/rubyserver"
@@ -49,15 +48,12 @@ func runBlobServer(t *testing.T) (*grpc.Server, string) {
go grpcServer.Serve(listener)
- return grpcServer, serverSocketPath
+ return grpcServer, "unix://" + serverSocketPath
}
func newBlobClient(t *testing.T, serverSocketPath string) (gitalypb.BlobServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/commit/testhelper_test.go b/internal/service/commit/testhelper_test.go
index 4747082cc..caa3a29b9 100644
--- a/internal/service/commit/testhelper_test.go
+++ b/internal/service/commit/testhelper_test.go
@@ -4,7 +4,6 @@ import (
"net"
"os"
"testing"
- "time"
"github.com/golang/protobuf/ptypes/timestamp"
log "github.com/sirupsen/logrus"
@@ -54,15 +53,12 @@ func startTestServices(t *testing.T) (*grpc.Server, string) {
reflection.Register(server)
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func newCommitServiceClient(t *testing.T, serviceSocketPath string) (gitalypb.CommitServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serviceSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/conflicts/resolve_conflicts_test.go b/internal/service/conflicts/resolve_conflicts_test.go
index 02c593c68..20bb2c298 100644
--- a/internal/service/conflicts/resolve_conflicts_test.go
+++ b/internal/service/conflicts/resolve_conflicts_test.go
@@ -318,5 +318,5 @@ func runFullServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
diff --git a/internal/service/conflicts/testhelper_test.go b/internal/service/conflicts/testhelper_test.go
index e58298096..713a971b8 100644
--- a/internal/service/conflicts/testhelper_test.go
+++ b/internal/service/conflicts/testhelper_test.go
@@ -4,7 +4,6 @@ import (
"net"
"os"
"testing"
- "time"
log "github.com/sirupsen/logrus"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
@@ -49,15 +48,12 @@ func runConflictsServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func NewConflictsClient(t *testing.T, serverSocketPath string) (gitalypb.ConflictsServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
diff --git a/internal/service/diff/testhelper_test.go b/internal/service/diff/testhelper_test.go
index 29a370429..bd5d79264 100644
--- a/internal/service/diff/testhelper_test.go
+++ b/internal/service/diff/testhelper_test.go
@@ -4,7 +4,6 @@ import (
"net"
"os"
"testing"
- "time"
log "github.com/sirupsen/logrus"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
@@ -49,15 +48,12 @@ func runDiffServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func newDiffClient(t *testing.T, serverSocketPath string) (gitalypb.DiffServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
diff --git a/internal/service/namespace/testhelper_test.go b/internal/service/namespace/testhelper_test.go
index 3e08713d0..8d76d82ef 100644
--- a/internal/service/namespace/testhelper_test.go
+++ b/internal/service/namespace/testhelper_test.go
@@ -3,7 +3,6 @@ package namespace
import (
"net"
"testing"
- "time"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
@@ -25,15 +24,12 @@ func runNamespaceServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func newNamespaceClient(t *testing.T, serverSocketPath string) (gitalypb.NamespaceServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/operations/cherry_pick_test.go b/internal/service/operations/cherry_pick_test.go
index d9440d2cb..dbdc04c27 100644
--- a/internal/service/operations/cherry_pick_test.go
+++ b/internal/service/operations/cherry_pick_test.go
@@ -409,5 +409,5 @@ func runFullServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
diff --git a/internal/service/operations/testhelper_test.go b/internal/service/operations/testhelper_test.go
index dc182a93e..3a5408f6b 100644
--- a/internal/service/operations/testhelper_test.go
+++ b/internal/service/operations/testhelper_test.go
@@ -7,7 +7,6 @@ import (
"os"
"path"
"testing"
- "time"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
@@ -87,15 +86,12 @@ func runOperationServiceServer(t *testing.T) (*grpc.Server, string) {
go grpcServer.Serve(listener)
- return grpcServer, serverSocketPath
+ return grpcServer, "unix://" + serverSocketPath
}
func newOperationClient(t *testing.T, serverSocketPath string) (gitalypb.OperationServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/ref/testhelper_test.go b/internal/service/ref/testhelper_test.go
index 10cfa05e7..3d7da42bb 100644
--- a/internal/service/ref/testhelper_test.go
+++ b/internal/service/ref/testhelper_test.go
@@ -5,7 +5,6 @@ import (
"net"
"os"
"testing"
- "time"
"github.com/golang/protobuf/ptypes/timestamp"
log "github.com/sirupsen/logrus"
@@ -113,15 +112,12 @@ func runRefServiceServer(t *testing.T) (*grpc.Server, string) {
go grpcServer.Serve(listener)
- return grpcServer, serverSocketPath
+ return grpcServer, "unix://" + serverSocketPath
}
func newRefServiceClient(t *testing.T, serverSocketPath string) (gitalypb.RefServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/remote/fetch_internal_remote_test.go b/internal/service/remote/fetch_internal_remote_test.go
index 22bfab29c..2d9bfc4d5 100644
--- a/internal/service/remote/fetch_internal_remote_test.go
+++ b/internal/service/remote/fetch_internal_remote_test.go
@@ -124,5 +124,5 @@ func runFullServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
diff --git a/internal/service/remote/testhelper_test.go b/internal/service/remote/testhelper_test.go
index 152c5b2be..3f37b1c60 100644
--- a/internal/service/remote/testhelper_test.go
+++ b/internal/service/remote/testhelper_test.go
@@ -5,7 +5,6 @@ import (
"net"
"os"
"testing"
- "time"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/rubyserver"
@@ -51,15 +50,12 @@ func runRemoteServiceServer(t *testing.T) (*grpc.Server, string) {
go grpcServer.Serve(listener)
- return grpcServer, serverSocketPath
+ return grpcServer, "unix://" + serverSocketPath
}
func NewRemoteClient(t *testing.T, serverSocketPath string) (gitalypb.RemoteServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/repository/fetch_test.go b/internal/service/repository/fetch_test.go
index a20160ad0..4d1d9756d 100644
--- a/internal/service/repository/fetch_test.go
+++ b/internal/service/repository/fetch_test.go
@@ -4,7 +4,6 @@ import (
"net"
"os"
"testing"
- "time"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
@@ -154,9 +153,6 @@ func TestFetchFullServerRequiresAuthentication(t *testing.T) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
@@ -197,5 +193,5 @@ func runFullServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
diff --git a/internal/service/repository/testhelper_test.go b/internal/service/repository/testhelper_test.go
index 20a8b6ef5..e2a8c1f95 100644
--- a/internal/service/repository/testhelper_test.go
+++ b/internal/service/repository/testhelper_test.go
@@ -30,9 +30,6 @@ var (
func newRepositoryClient(t *testing.T, serverSocketPath string) (gitalypb.RepositoryServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
grpc.WithPerRPCCredentials(gitalyauth.RPCCredentials(testhelper.RepositoryAuthToken)),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
@@ -62,7 +59,7 @@ func runRepoServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func assertModTimeAfter(t *testing.T, afterTime time.Time, paths ...string) bool {
diff --git a/internal/service/server/info_test.go b/internal/service/server/info_test.go
index 5f10b0774..374b4c785 100644
--- a/internal/service/server/info_test.go
+++ b/internal/service/server/info_test.go
@@ -3,7 +3,6 @@ package server
import (
"net"
"testing"
- "time"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
@@ -71,15 +70,12 @@ func runServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func newServerClient(t *testing.T, serverSocketPath string) (gitalypb.ServerServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
grpc.WithPerRPCCredentials(gitalyauth.RPCCredentials(testhelper.RepositoryAuthToken)),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
diff --git a/internal/service/smarthttp/testhelper_test.go b/internal/service/smarthttp/testhelper_test.go
index ee2642b2e..23db1f2ac 100644
--- a/internal/service/smarthttp/testhelper_test.go
+++ b/internal/service/smarthttp/testhelper_test.go
@@ -3,7 +3,6 @@ package smarthttp
import (
"net"
"testing"
- "time"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/testhelper"
@@ -29,15 +28,12 @@ func runSmartHTTPServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func newSmartHTTPClient(t *testing.T, serverSocketPath string) (gitalypb.SmartHTTPServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/ssh/receive_pack_test.go b/internal/service/ssh/receive_pack_test.go
index 55f1e4740..5b880cebc 100644
--- a/internal/service/ssh/receive_pack_test.go
+++ b/internal/service/ssh/receive_pack_test.go
@@ -201,7 +201,7 @@ func testCloneAndPush(t *testing.T, serverSocketPath string, params pushParams)
cmd := exec.Command("git", "-C", localRepoPath, "push", "-v", "git@localhost:test/test.git", "master")
cmd.Env = []string{
fmt.Sprintf("GITALY_PAYLOAD=%s", payload),
- fmt.Sprintf("GITALY_ADDRESS=unix:%s", serverSocketPath),
+ fmt.Sprintf("GITALY_ADDRESS=%s", serverSocketPath),
fmt.Sprintf("PATH=%s", ".:"+os.Getenv("PATH")),
fmt.Sprintf(`GIT_SSH_COMMAND=%s receive-pack`, gitalySSHPath),
}
diff --git a/internal/service/ssh/testhelper_test.go b/internal/service/ssh/testhelper_test.go
index 68ced139c..b22fd7c33 100644
--- a/internal/service/ssh/testhelper_test.go
+++ b/internal/service/ssh/testhelper_test.go
@@ -5,7 +5,6 @@ import (
"os"
"path"
"testing"
- "time"
log "github.com/sirupsen/logrus"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
@@ -72,15 +71,12 @@ func runSSHServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func newSSHClient(t *testing.T, serverSocketPath string) (gitalypb.SSHServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/ssh/upload_archive_test.go b/internal/service/ssh/upload_archive_test.go
index c639c003b..8264b6314 100644
--- a/internal/service/ssh/upload_archive_test.go
+++ b/internal/service/ssh/upload_archive_test.go
@@ -81,7 +81,7 @@ func testArchive(t *testing.T, serverSocketPath string, testRepo *gitalypb.Repos
require.NoError(t, err)
cmd.Env = []string{
- fmt.Sprintf("GITALY_ADDRESS=unix:%s", serverSocketPath),
+ fmt.Sprintf("GITALY_ADDRESS=%s", serverSocketPath),
fmt.Sprintf("GITALY_PAYLOAD=%s", payload),
fmt.Sprintf("PATH=%s", ".:"+os.Getenv("PATH")),
fmt.Sprintf(`GIT_SSH_COMMAND=%s upload-archive`, gitalySSHPath),
diff --git a/internal/service/ssh/upload_pack_test.go b/internal/service/ssh/upload_pack_test.go
index d62734e2f..a52cc99ae 100644
--- a/internal/service/ssh/upload_pack_test.go
+++ b/internal/service/ssh/upload_pack_test.go
@@ -188,7 +188,7 @@ func testClone(t *testing.T, serverSocketPath, storageName, relativePath, localR
require.NoError(t, err)
cmd.Env = []string{
- fmt.Sprintf("GITALY_ADDRESS=unix:%s", serverSocketPath),
+ fmt.Sprintf("GITALY_ADDRESS=%s", serverSocketPath),
fmt.Sprintf("GITALY_PAYLOAD=%s", payload),
fmt.Sprintf("PATH=%s", ".:"+os.Getenv("PATH")),
fmt.Sprintf(`GIT_SSH_COMMAND=%s upload-pack`, gitalySSHPath),
diff --git a/internal/service/storage/testhelper_test.go b/internal/service/storage/testhelper_test.go
index aeb405ca6..4694edea0 100644
--- a/internal/service/storage/testhelper_test.go
+++ b/internal/service/storage/testhelper_test.go
@@ -5,7 +5,6 @@ import (
"os"
"path/filepath"
"testing"
- "time"
"gitlab.com/gitlab-org/gitaly-proto/go/gitalypb"
"gitlab.com/gitlab-org/gitaly/internal/config"
@@ -54,15 +53,12 @@ func runStorageServer(t *testing.T) (*grpc.Server, string) {
go server.Serve(listener)
- return server, serverSocketPath
+ return server, "unix://" + serverSocketPath
}
func newStorageClient(t *testing.T, serverSocketPath string) (gitalypb.StorageServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/service/wiki/testhelper_test.go b/internal/service/wiki/testhelper_test.go
index 7d6b2e503..1637d1ffc 100644
--- a/internal/service/wiki/testhelper_test.go
+++ b/internal/service/wiki/testhelper_test.go
@@ -7,7 +7,6 @@ import (
"path"
"strings"
"testing"
- "time"
log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
@@ -65,15 +64,12 @@ func runWikiServiceServer(t *testing.T) (*grpc.Server, string) {
go grpcServer.Serve(listener)
- return grpcServer, serverSocketPath
+ return grpcServer, "unix://" + serverSocketPath
}
func newWikiClient(t *testing.T, serverSocketPath string) (gitalypb.WikiServiceClient, *grpc.ClientConn) {
connOpts := []grpc.DialOption{
grpc.WithInsecure(),
- grpc.WithDialer(func(addr string, timeout time.Duration) (net.Conn, error) {
- return net.DialTimeout("unix", addr, timeout)
- }),
}
conn, err := grpc.Dial(serverSocketPath, connOpts...)
if err != nil {
diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go
index 285de96bf..a612dd3a2 100644
--- a/internal/testhelper/testhelper.go
+++ b/internal/testhelper/testhelper.go
@@ -86,7 +86,7 @@ func GitlabTestStoragePath() string {
func GitalyServersMetadata(t *testing.T, serverSocketPath string) metadata.MD {
gitalyServers := storage.GitalyServers{
"default": {
- "address": "unix:" + serverSocketPath,
+ "address": serverSocketPath,
"token": RepositoryAuthToken,
},
}