diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-01-07 11:42:39 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-01-12 14:22:48 +0300 |
commit | 43a7a52d4bf9baf8ed28bca44c751afd8a93b843 (patch) | |
tree | 0bf53036362430572d392a4ed887d4f01919407f /internal/praefect/replicator_test.go | |
parent | 25ea884b54a3be6f7a9f2dfffb885f29f6104c1f (diff) |
testhelper: Use test context in `GetTemporaryGitalySocketFileName()`
The `testhelper.GetTemporaryGitalySocketFileName()` function currently
returns an error. Given that all callers use `require.NoError()` on that
error, let's convert it to instead receive a `testing.TB` and not return
an error.
Diffstat (limited to 'internal/praefect/replicator_test.go')
-rw-r--r-- | internal/praefect/replicator_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/praefect/replicator_test.go b/internal/praefect/replicator_test.go index ef5ff1ba7..121a2142e 100644 --- a/internal/praefect/replicator_test.go +++ b/internal/praefect/replicator_test.go @@ -469,7 +469,7 @@ func (m *mockRepositoryServer) RepackIncremental(ctx context.Context, in *gitaly func runMockRepositoryServer(t *testing.T) (*mockRepositoryServer, string, func()) { server := testhelper.NewTestGrpcServer(t, nil, nil) - serverSocketPath := testhelper.GetTemporaryGitalySocketFileName() + serverSocketPath := testhelper.GetTemporaryGitalySocketFileName(t) listener, err := net.Listen("unix", serverSocketPath) require.NoError(t, err) @@ -1003,7 +1003,7 @@ func runFullGitalyServer(t *testing.T) (string, func()) { conns := client.NewPool() server := serverPkg.NewInsecure(RubyServer, hook.NewManager(gitaly_config.NewLocator(gitaly_config.Config), hook.GitlabAPIStub, gitaly_config.Config), gitaly_config.Config, conns) - serverSocketPath := testhelper.GetTemporaryGitalySocketFileName() + serverSocketPath := testhelper.GetTemporaryGitalySocketFileName(t) listener, err := net.Listen("unix", serverSocketPath) if err != nil { @@ -1025,7 +1025,7 @@ func runFullGitalyServer(t *testing.T) (string, func()) { // newReplicationService is a grpc service that has the SSH, Repository, Remote and ObjectPool services, which // are the only ones needed for replication func newReplicationService(tb testing.TB) (*grpc.Server, string) { - socketName := testhelper.GetTemporaryGitalySocketFileName() + socketName := testhelper.GetTemporaryGitalySocketFileName(tb) internalSocketName := gitaly_config.Config.GitalyInternalSocketPath() require.NoError(tb, os.RemoveAll(internalSocketName)) |