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>2023-08-22 14:46:13 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2023-08-31 09:29:18 +0300
commit97b4c2fdfb7fe78be017fd3819a1849039a02377 (patch)
treea8c1b8f1835227cb45f7d8c56148fe2dae97d165
parenta3dedd2661cada20c703b79d93c6fbbb62d48f90 (diff)
Replace NewLogger calls with SharedLogger calls in tests
This commit wires the tests to call SharedLogger instead of NewLogger so they'll use the test case's shared logger. This way the log output is printed to the same logger and is ordered.
-rw-r--r--client/dial_test.go4
-rw-r--r--cmd/gitaly-backup/create_test.go4
-rw-r--r--cmd/gitaly-backup/restore_test.go4
-rw-r--r--cmd/gitaly-lfs-smudge/smudge_test.go6
-rw-r--r--cmd/gitaly-ssh/main_test.go2
-rw-r--r--internal/backup/pipeline_test.go8
-rw-r--r--internal/bootstrap/bootstrap_test.go6
-rw-r--r--internal/cache/diskcache_test.go4
-rw-r--r--internal/cache/walker_test.go8
-rw-r--r--internal/cgroups/cgroups_linux_test.go2
-rw-r--r--internal/cgroups/v1_linux_test.go30
-rw-r--r--internal/cgroups/v2_linux_test.go26
-rw-r--r--internal/cli/praefect/subcmd_remove_repository_test.go2
-rw-r--r--internal/cli/praefect/subcmd_track_repositories_test.go2
-rw-r--r--internal/cli/praefect/subcmd_track_repository_test.go2
-rw-r--r--internal/dontpanic/retry_test.go10
-rw-r--r--internal/git/command_factory_test.go22
-rw-r--r--internal/git/gittest/command_factory.go2
-rw-r--r--internal/git/testhelper_test.go2
-rw-r--r--internal/gitaly/config/temp_dir_test.go6
-rw-r--r--internal/gitaly/maintenance/daily_test.go2
-rw-r--r--internal/gitaly/maintenance/optimize_test.go2
-rw-r--r--internal/gitaly/server/auth_test.go6
-rw-r--r--internal/gitaly/server/server_factory_test.go16
-rw-r--r--internal/gitaly/service/hook/post_receive_test.go4
-rw-r--r--internal/gitaly/service/hook/pre_receive_test.go8
-rw-r--r--internal/gitaly/service/objectpool/fetch_into_object_pool_test.go2
-rw-r--r--internal/gitaly/service/objectpool/testhelper_test.go2
-rw-r--r--internal/gitaly/service/operations/tags_test.go2
-rw-r--r--internal/gitaly/service/operations/user_create_branch_test.go2
-rw-r--r--internal/gitaly/service/operations/user_delete_branch_test.go2
-rw-r--r--internal/gitaly/service/repository/apply_gitattributes_test.go2
-rw-r--r--internal/gitaly/service/repository/replicate_test.go2
-rw-r--r--internal/gitaly/service/smarthttp/inforefs_test.go2
-rw-r--r--internal/gitaly/service/smarthttp/testhelper_test.go2
-rw-r--r--internal/gitaly/service/smarthttp/upload_pack_test.go2
-rw-r--r--internal/gitaly/service/ssh/upload_pack_test.go2
-rw-r--r--internal/gitaly/storage/counter/counter_test.go2
-rw-r--r--internal/gitaly/storage/storagemgr/partition_assigner_test.go8
-rw-r--r--internal/gitaly/storage/storagemgr/partition_manager_test.go2
-rw-r--r--internal/gitaly/storage/storagemgr/transaction_manager_test.go4
-rw-r--r--internal/gitlab/client/gitlabnet_test.go2
-rw-r--r--internal/gitlab/http_client_test.go12
-rw-r--r--internal/grpc/backchannel/backchannel_test.go12
-rw-r--r--internal/grpc/client/dial_test.go2
-rw-r--r--internal/grpc/dnsresolver/builder_test.go4
-rw-r--r--internal/grpc/dnsresolver/resolver_test.go4
-rw-r--r--internal/grpc/dnsresolver/testhelper_test.go2
-rw-r--r--internal/grpc/middleware/cache/cache_test.go4
-rw-r--r--internal/grpc/sidechannel/proxy_test.go4
-rw-r--r--internal/grpc/sidechannel/sidechannel_test.go4
-rw-r--r--internal/limiter/adaptive_calculator_test.go2
-rw-r--r--internal/praefect/auth_test.go2
-rw-r--r--internal/praefect/coordinator_test.go14
-rw-r--r--internal/praefect/datastore/collector_test.go2
-rw-r--r--internal/praefect/datastore/storage_provider_test.go4
-rw-r--r--internal/praefect/get_object_pool_test.go2
-rw-r--r--internal/praefect/info_service_test.go2
-rw-r--r--internal/praefect/nodes/health_manager_test.go8
-rw-r--r--internal/praefect/nodes/local_elector_test.go6
-rw-r--r--internal/praefect/nodes/manager_test.go14
-rw-r--r--internal/praefect/nodes/sql_elector_test.go14
-rw-r--r--internal/praefect/reconciler/reconciler_benchmark_test.go2
-rw-r--r--internal/praefect/reconciler/reconciler_test.go4
-rw-r--r--internal/praefect/remove_all_test.go2
-rw-r--r--internal/praefect/remove_repository_test.go2
-rw-r--r--internal/praefect/replicator_pg_test.go4
-rw-r--r--internal/praefect/replicator_test.go20
-rw-r--r--internal/praefect/repocleaner/repository_test.go2
-rw-r--r--internal/praefect/repository_exists_test.go2
-rw-r--r--internal/praefect/server_factory_test.go2
-rw-r--r--internal/praefect/server_test.go12
-rw-r--r--internal/praefect/testserver.go4
-rw-r--r--internal/praefect/verifier_test.go2
-rw-r--r--internal/streamcache/cache_test.go4
-rw-r--r--internal/streamcache/filestore_test.go8
-rw-r--r--internal/tempdir/clean_test.go8
77 files changed, 213 insertions, 213 deletions
diff --git a/client/dial_test.go b/client/dial_test.go
index 190378b11..a8aec4788 100644
--- a/client/dial_test.go
+++ b/client/dial_test.go
@@ -676,7 +676,7 @@ var dialFuncs = []struct {
{
name: "DialSidechannel",
dial: func(t *testing.T, rawAddress string, connOpts []grpc.DialOption) (*grpc.ClientConn, error) {
- sr := NewSidechannelRegistry(testhelper.NewLogger(t))
+ sr := NewSidechannelRegistry(testhelper.SharedLogger(t))
return DialSidechannel(testhelper.Context(t), rawAddress, sr, connOpts)
},
},
@@ -805,5 +805,5 @@ func startFakeGitalyServer(t *testing.T) string {
}
func newLogger(tb testing.TB) *logrus.Entry {
- return logrus.NewEntry(testhelper.NewLogger(tb))
+ return logrus.NewEntry(testhelper.SharedLogger(tb))
}
diff --git a/cmd/gitaly-backup/create_test.go b/cmd/gitaly-backup/create_test.go
index 367d820e9..b38bf24ca 100644
--- a/cmd/gitaly-backup/create_test.go
+++ b/cmd/gitaly-backup/create_test.go
@@ -61,7 +61,7 @@ func TestCreateSubcommand(t *testing.T) {
require.NoError(t, fs.Parse([]string{"-path", path, "-id", "the-new-backup"}))
require.EqualError(t,
- cmd.Run(ctx, testhelper.NewLogger(t), &stdin, io.Discard),
+ cmd.Run(ctx, testhelper.SharedLogger(t), &stdin, io.Discard),
"create: pipeline: 1 failures encountered:\n - invalid: manager: could not dial source: invalid connection string: \"invalid\"\n")
for _, repo := range repos {
@@ -118,7 +118,7 @@ func TestCreateSubcommand_serverSide(t *testing.T) {
require.NoError(t, fs.Parse([]string{"-server-side", "-id", "the-new-backup"}))
require.EqualError(t,
- cmd.Run(ctx, testhelper.NewLogger(t), &stdin, io.Discard),
+ cmd.Run(ctx, testhelper.SharedLogger(t), &stdin, io.Discard),
"create: pipeline: 1 failures encountered:\n - invalid: server-side create: could not dial source: invalid connection string: \"invalid\"\n")
for _, repo := range repos {
diff --git a/cmd/gitaly-backup/restore_test.go b/cmd/gitaly-backup/restore_test.go
index ae21c508f..600ad9314 100644
--- a/cmd/gitaly-backup/restore_test.go
+++ b/cmd/gitaly-backup/restore_test.go
@@ -91,7 +91,7 @@ Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/5269`)
require.NoError(t, fs.Parse([]string{"-path", path, "-remove-all-repositories", existingRepo.StorageName}))
require.EqualError(t,
- cmd.Run(ctx, testhelper.NewLogger(t), &stdin, io.Discard),
+ cmd.Run(ctx, testhelper.SharedLogger(t), &stdin, io.Discard),
"restore: pipeline: 1 failures encountered:\n - invalid: manager: could not dial source: invalid connection string: \"invalid\"\n")
require.NoDirExists(t, existRepoPath)
@@ -183,7 +183,7 @@ Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/5269`)
require.NoError(t, fs.Parse([]string{"-server-side", "-remove-all-repositories", existingRepo.StorageName}))
require.EqualError(t,
- cmd.Run(ctx, testhelper.NewLogger(t), &stdin, io.Discard),
+ cmd.Run(ctx, testhelper.SharedLogger(t), &stdin, io.Discard),
"restore: pipeline: 1 failures encountered:\n - invalid: server-side restore: could not dial source: invalid connection string: \"invalid\"\n")
require.NoDirExists(t, existRepoPath)
diff --git a/cmd/gitaly-lfs-smudge/smudge_test.go b/cmd/gitaly-lfs-smudge/smudge_test.go
index 43715db4f..97689e286 100644
--- a/cmd/gitaly-lfs-smudge/smudge_test.go
+++ b/cmd/gitaly-lfs-smudge/smudge_test.go
@@ -84,7 +84,7 @@ func TestFilter_successful(t *testing.T) {
},
}
- require.NoError(t, filter(ctx, cfg, &b, reader, testhelper.NewLogger(t)))
+ require.NoError(t, filter(ctx, cfg, &b, reader, testhelper.SharedLogger(t)))
require.Equal(t, testData, b.String())
})
}
@@ -185,7 +185,7 @@ func TestFilter_unsuccessful(t *testing.T) {
cfg := tc.setupCfg(t, gitlabCfg)
var b bytes.Buffer
- err := filter(ctx, cfg, &b, strings.NewReader(tc.data), testhelper.NewLogger(t))
+ err := filter(ctx, cfg, &b, strings.NewReader(tc.data), testhelper.SharedLogger(t))
if tc.expectedError {
require.Error(t, err)
@@ -558,7 +558,7 @@ func TestProcess(t *testing.T) {
}
var outputBuffer bytes.Buffer
- require.Equal(t, tc.expectedErr, process(ctx, tc.cfg, &outputBuffer, &inputBuffer, testhelper.NewLogger(t)))
+ require.Equal(t, tc.expectedErr, process(ctx, tc.cfg, &outputBuffer, &inputBuffer, testhelper.SharedLogger(t)))
require.Equal(t, tc.expectedOutput, outputBuffer.String())
})
}
diff --git a/cmd/gitaly-ssh/main_test.go b/cmd/gitaly-ssh/main_test.go
index 9545205aa..258509e9c 100644
--- a/cmd/gitaly-ssh/main_test.go
+++ b/cmd/gitaly-ssh/main_test.go
@@ -103,7 +103,7 @@ func TestRun(t *testing.T) {
payload: "{}",
}
- gotCode, err := cmd.run(testhelper.NewLogger(t))
+ gotCode, err := cmd.run(testhelper.SharedLogger(t))
if tt.wantErr {
assert.Error(t, err)
} else {
diff --git a/internal/backup/pipeline_test.go b/internal/backup/pipeline_test.go
index 7bd4e5ca0..62c371352 100644
--- a/internal/backup/pipeline_test.go
+++ b/internal/backup/pipeline_test.go
@@ -17,7 +17,7 @@ func TestLoggingPipeline(t *testing.T) {
t.Parallel()
testPipeline(t, func() Pipeline {
- return NewLoggingPipeline(testhelper.NewLogger(t))
+ return NewLoggingPipeline(testhelper.SharedLogger(t))
})
}
@@ -25,7 +25,7 @@ func TestParallelPipeline(t *testing.T) {
t.Parallel()
testPipeline(t, func() Pipeline {
- return NewParallelPipeline(NewLoggingPipeline(testhelper.NewLogger(t)), 2, 0)
+ return NewParallelPipeline(NewLoggingPipeline(testhelper.SharedLogger(t)), 2, 0)
})
t.Run("parallelism", func(t *testing.T) {
@@ -64,7 +64,7 @@ func TestParallelPipeline(t *testing.T) {
},
}
var p Pipeline
- p = NewLoggingPipeline(testhelper.NewLogger(t))
+ p = NewLoggingPipeline(testhelper.SharedLogger(t))
p = NewParallelPipeline(p, tc.parallel, tc.parallelStorage)
ctx := testhelper.Context(t)
@@ -80,7 +80,7 @@ func TestParallelPipeline(t *testing.T) {
t.Run("context done", func(t *testing.T) {
var strategy MockStrategy
var p Pipeline
- p = NewLoggingPipeline(testhelper.NewLogger(t))
+ p = NewLoggingPipeline(testhelper.SharedLogger(t))
p = NewParallelPipeline(p, 0, 0) // make sure worker channels always block
ctx, cancel := context.WithCancel(testhelper.Context(t))
diff --git a/internal/bootstrap/bootstrap_test.go b/internal/bootstrap/bootstrap_test.go
index c9cd7e131..fa9f3155b 100644
--- a/internal/bootstrap/bootstrap_test.go
+++ b/internal/bootstrap/bootstrap_test.go
@@ -74,7 +74,7 @@ func TestBootstrap_unixListener(t *testing.T) {
hasParent: tc.hasParent,
}
- b, err := _new(testhelper.NewLogger(t), upgrader, listen, false, &prometheus.CounterVec{})
+ b, err := _new(testhelper.SharedLogger(t), upgrader, listen, false, &prometheus.CounterVec{})
require.NoError(t, err)
if tc.preexistingSocket {
@@ -219,7 +219,7 @@ func TestBootstrap_gracefulTermination(t *testing.T) {
}
func TestBootstrap_portReuse(t *testing.T) {
- b, err := New(testhelper.NewLogger(t), &prometheus.CounterVec{})
+ b, err := New(testhelper.SharedLogger(t), &prometheus.CounterVec{})
require.NoError(t, err)
l, err := b.listen("tcp", "localhost:")
@@ -267,7 +267,7 @@ func setup(t *testing.T, ctx context.Context) (*Bootstrap, *mockUpgrader, mockLi
readyCh: make(chan error),
}
- b, err := _new(testhelper.NewLogger(t), u, net.Listen, false, &prometheus.CounterVec{})
+ b, err := _new(testhelper.SharedLogger(t), u, net.Listen, false, &prometheus.CounterVec{})
require.NoError(t, err)
listeners := mockListeners{}
diff --git a/internal/cache/diskcache_test.go b/internal/cache/diskcache_test.go
index 35ff6bc34..c2795b4fd 100644
--- a/internal/cache/diskcache_test.go
+++ b/internal/cache/diskcache_test.go
@@ -58,7 +58,7 @@ func TestStreamDBNaiveKeyer(t *testing.T) {
})
gittest.WriteCommit(t, cfg, repoPath2, gittest.WithMessage("two"), gittest.WithBranch("master"))
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
locator := config.NewLocator(cfg)
req1 := &gitalypb.InfoRefsRequest{
@@ -167,7 +167,7 @@ func TestLoserCount(t *testing.T) {
cfg := cfgBuilder.Build(t)
locator := config.NewLocator(cfg)
- cache := New(cfg, locator, testhelper.NewLogger(t))
+ cache := New(cfg, locator, testhelper.SharedLogger(t))
req := &gitalypb.InfoRefsRequest{
Repository: &gitalypb.Repository{
diff --git a/internal/cache/walker_test.go b/internal/cache/walker_test.go
index 925b2e106..f9b176f6c 100644
--- a/internal/cache/walker_test.go
+++ b/internal/cache/walker_test.go
@@ -52,7 +52,7 @@ func TestDiskCacheObjectWalker(t *testing.T) {
}
}
- cache := New(cfg, locator, testhelper.NewLogger(t), withDisabledMoveAndClear())
+ cache := New(cfg, locator, testhelper.SharedLogger(t), withDisabledMoveAndClear())
require.NoError(t, cache.StartWalkers())
defer cache.StopWalkers()
@@ -81,7 +81,7 @@ func TestDiskCacheInitialClear(t *testing.T) {
require.NoError(t, os.MkdirAll(filepath.Dir(canary), perm.SharedDir))
require.NoError(t, os.WriteFile(canary, []byte("chirp chirp"), perm.PublicFile))
- cache := New(cfg, locator, testhelper.NewLogger(t), withDisabledWalker())
+ cache := New(cfg, locator, testhelper.SharedLogger(t), withDisabledWalker())
require.NoError(t, cache.StartWalkers())
defer cache.StopWalkers()
@@ -91,7 +91,7 @@ func TestDiskCacheInitialClear(t *testing.T) {
func TestCleanWalkDirNotExists(t *testing.T) {
cfg := testcfg.Build(t)
- cache := New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t))
+ cache := New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t))
err := cache.cleanWalk("/path/that/does/not/exist")
assert.NoError(t, err, "cleanWalk returned an error for a non existing directory")
@@ -124,7 +124,7 @@ func TestCleanWalkEmptyDirs(t *testing.T) {
}
cfg := testcfg.Build(t)
- cache := New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t))
+ cache := New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t))
require.NoError(t, cache.cleanWalk(tmp))
diff --git a/internal/cgroups/cgroups_linux_test.go b/internal/cgroups/cgroups_linux_test.go
index 3ca07c6bd..c3e7e143d 100644
--- a/internal/cgroups/cgroups_linux_test.go
+++ b/internal/cgroups/cgroups_linux_test.go
@@ -11,5 +11,5 @@ import (
)
func TestNewManager(t *testing.T) {
- require.IsType(t, &NoopManager{}, NewManager(cgroups.Config{}, testhelper.NewLogger(t), 1))
+ require.IsType(t, &NoopManager{}, NewManager(cgroups.Config{}, testhelper.SharedLogger(t), 1))
}
diff --git a/internal/cgroups/v1_linux_test.go b/internal/cgroups/v1_linux_test.go
index cd97ffbfb..d8bc70383 100644
--- a/internal/cgroups/v1_linux_test.go
+++ b/internal/cgroups/v1_linux_test.go
@@ -38,11 +38,11 @@ func defaultCgroupsConfig() cgroups.Config {
func TestNewManagerV1(t *testing.T) {
cfg := cgroups.Config{Repositories: cgroups.Repositories{Count: 10}}
- manager := newCgroupManagerWithMode(cfg, testhelper.NewLogger(t), 1, cgrps.Legacy)
+ manager := newCgroupManagerWithMode(cfg, testhelper.SharedLogger(t), 1, cgrps.Legacy)
require.IsType(t, &cgroupV1Handler{}, manager.handler)
- manager = newCgroupManagerWithMode(cfg, testhelper.NewLogger(t), 1, cgrps.Hybrid)
+ manager = newCgroupManagerWithMode(cfg, testhelper.SharedLogger(t), 1, cgrps.Hybrid)
require.IsType(t, &cgroupV1Handler{}, manager.handler)
- manager = newCgroupManagerWithMode(cfg, testhelper.NewLogger(t), 1, cgrps.Unavailable)
+ manager = newCgroupManagerWithMode(cfg, testhelper.SharedLogger(t), 1, cgrps.Unavailable)
require.Nil(t, manager)
}
@@ -101,7 +101,7 @@ func TestSetup_ParentCgroups(t *testing.T) {
tt.cfg.HierarchyRoot = "gitaly"
tt.cfg.Mountpoint = mock.root
- v1Manager := mock.newCgroupManager(tt.cfg, testhelper.NewLogger(t), pid)
+ v1Manager := mock.newCgroupManager(tt.cfg, testhelper.SharedLogger(t), pid)
require.False(t, v1Manager.Ready())
require.NoError(t, v1Manager.Setup())
require.True(t, v1Manager.Ready())
@@ -184,7 +184,7 @@ func TestSetup_RepoCgroups(t *testing.T) {
cfg.HierarchyRoot = "gitaly"
cfg.Mountpoint = mock.root
- v1Manager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ v1Manager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
require.False(t, v1Manager.Ready())
require.NoError(t, v1Manager.Setup())
@@ -226,14 +226,14 @@ func TestAddCommand(t *testing.T) {
config.Mountpoint = mock.root
pid := 1
- v1Manager1 := mock.newCgroupManager(config, testhelper.NewLogger(t), pid)
+ v1Manager1 := mock.newCgroupManager(config, testhelper.SharedLogger(t), pid)
require.NoError(t, v1Manager1.Setup())
ctx := testhelper.Context(t)
cmd2 := exec.CommandContext(ctx, "ls", "-hal", ".")
require.NoError(t, cmd2.Run())
- v1Manager2 := mock.newCgroupManager(config, testhelper.NewLogger(t), pid)
+ v1Manager2 := mock.newCgroupManager(config, testhelper.SharedLogger(t), pid)
t.Run("without overridden key", func(t *testing.T) {
_, err := v1Manager2.AddCommand(cmd2)
@@ -281,7 +281,7 @@ func TestCleanup(t *testing.T) {
cfg := defaultCgroupsConfig()
cfg.Mountpoint = mock.root
- v1Manager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ v1Manager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
require.NoError(t, v1Manager.Setup())
require.NoError(t, v1Manager.Cleanup())
@@ -348,7 +348,7 @@ gitaly_cgroup_cpu_cfs_throttled_seconds_total{path="%s"} 0.001
config.Mountpoint = mock.root
config.MetricsEnabled = tt.metricsEnabled
- v1Manager1 := mock.newCgroupManager(config, testhelper.NewLogger(t), tt.pid)
+ v1Manager1 := mock.newCgroupManager(config, testhelper.SharedLogger(t), tt.pid)
mock.setupMockCgroupFiles(t, v1Manager1, mockCgroupFile{"memory.failcnt", "2"})
require.NoError(t, v1Manager1.Setup())
@@ -406,7 +406,7 @@ func TestPruneOldCgroups(t *testing.T) {
},
setup: func(t *testing.T, cfg cgroups.Config, mock *mockCgroup) int {
pid := 1
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
require.NoError(t, cgroupManager.Setup())
return pid
@@ -425,7 +425,7 @@ func TestPruneOldCgroups(t *testing.T) {
},
setup: func(t *testing.T, cfg cgroups.Config, mock *mockCgroup) int {
pid := 1
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
require.NoError(t, cgroupManager.Setup())
return 1
},
@@ -446,7 +446,7 @@ func TestPruneOldCgroups(t *testing.T) {
require.NoError(t, cmd.Run())
pid := cmd.Process.Pid
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
require.NoError(t, cgroupManager.Setup())
memoryRoot := filepath.Join(
@@ -474,7 +474,7 @@ func TestPruneOldCgroups(t *testing.T) {
setup: func(t *testing.T, cfg cgroups.Config, mock *mockCgroup) int {
pid := os.Getpid()
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
require.NoError(t, cgroupManager.Setup())
return pid
@@ -492,7 +492,7 @@ func TestPruneOldCgroups(t *testing.T) {
},
},
setup: func(t *testing.T, cfg cgroups.Config, mock *mockCgroup) int {
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), 0)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), 0)
require.NoError(t, cgroupManager.Setup())
return 0
@@ -599,7 +599,7 @@ throttled_time 1000000`}, // 0.001 seconds
config.Repositories.CPUShares = 16
config.Mountpoint = mock.root
- v1Manager := mock.newCgroupManager(config, testhelper.NewLogger(t), 1)
+ v1Manager := mock.newCgroupManager(config, testhelper.SharedLogger(t), 1)
mock.setupMockCgroupFiles(t, v1Manager, tc.mockFiles...)
require.NoError(t, v1Manager.Setup())
diff --git a/internal/cgroups/v2_linux_test.go b/internal/cgroups/v2_linux_test.go
index 8985c7349..0215edb39 100644
--- a/internal/cgroups/v2_linux_test.go
+++ b/internal/cgroups/v2_linux_test.go
@@ -38,7 +38,7 @@ func defaultCgroupsV2Config() cgroups.Config {
func TestNewManagerV2(t *testing.T) {
cfg := cgroups.Config{Repositories: cgroups.Repositories{Count: 10}}
- manager := newCgroupManagerWithMode(cfg, testhelper.NewLogger(t), 1, cgrps.Unified)
+ manager := newCgroupManagerWithMode(cfg, testhelper.SharedLogger(t), 1, cgrps.Unified)
require.IsType(t, &cgroupV2Handler{}, manager.handler)
}
@@ -95,7 +95,7 @@ func TestSetup_ParentCgroupsV2(t *testing.T) {
tt.cfg.HierarchyRoot = "gitaly"
tt.cfg.Mountpoint = mock.root
- v2Manager := mock.newCgroupManager(tt.cfg, testhelper.NewLogger(t), pid)
+ v2Manager := mock.newCgroupManager(tt.cfg, testhelper.SharedLogger(t), pid)
mock.setupMockCgroupFiles(t, v2Manager)
require.False(t, v2Manager.Ready())
@@ -174,7 +174,7 @@ func TestSetup_RepoCgroupsV2(t *testing.T) {
cfg.Mountpoint = mock.root
cfg.Repositories = tt.cfg
- v2Manager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ v2Manager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
mock.setupMockCgroupFiles(t, v2Manager)
require.False(t, v2Manager.Ready())
@@ -212,7 +212,7 @@ func TestAddCommandV2(t *testing.T) {
pid := 1
- v2Manager1 := mock.newCgroupManager(config, testhelper.NewLogger(t), pid)
+ v2Manager1 := mock.newCgroupManager(config, testhelper.SharedLogger(t), pid)
mock.setupMockCgroupFiles(t, v2Manager1)
require.NoError(t, v2Manager1.Setup())
@@ -221,7 +221,7 @@ func TestAddCommandV2(t *testing.T) {
cmd2 := exec.CommandContext(ctx, "ls", "-hal", ".")
require.NoError(t, cmd2.Run())
- v2Manager2 := mock.newCgroupManager(config, testhelper.NewLogger(t), pid)
+ v2Manager2 := mock.newCgroupManager(config, testhelper.SharedLogger(t), pid)
t.Run("without overridden key", func(t *testing.T) {
_, err := v2Manager2.AddCommand(cmd2)
@@ -265,7 +265,7 @@ func TestCleanupV2(t *testing.T) {
cfg := defaultCgroupsV2Config()
cfg.Mountpoint = mock.root
- v2Manager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ v2Manager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
mock.setupMockCgroupFiles(t, v2Manager)
require.NoError(t, v2Manager.Setup())
@@ -327,7 +327,7 @@ gitaly_cgroup_procs_total{path="%s",subsystem="memory"} 1
config.Mountpoint = mock.root
config.MetricsEnabled = tt.metricsEnabled
- v2Manager1 := mock.newCgroupManager(config, testhelper.NewLogger(t), tt.pid)
+ v2Manager1 := mock.newCgroupManager(config, testhelper.SharedLogger(t), tt.pid)
mock.setupMockCgroupFiles(t, v2Manager1)
require.NoError(t, v2Manager1.Setup())
@@ -387,7 +387,7 @@ func TestPruneOldCgroupsV2(t *testing.T) {
setup: func(t *testing.T, cfg cgroups.Config, mock *mockCgroupV2) int {
pid := 1
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
mock.setupMockCgroupFiles(t, cgroupManager)
require.NoError(t, cgroupManager.Setup())
@@ -408,7 +408,7 @@ func TestPruneOldCgroupsV2(t *testing.T) {
setup: func(t *testing.T, cfg cgroups.Config, mock *mockCgroupV2) int {
pid := 1
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
mock.setupMockCgroupFiles(t, cgroupManager)
require.NoError(t, cgroupManager.Setup())
return 1
@@ -430,7 +430,7 @@ func TestPruneOldCgroupsV2(t *testing.T) {
require.NoError(t, cmd.Run())
pid := cmd.Process.Pid
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
mock.setupMockCgroupFiles(t, cgroupManager)
require.NoError(t, cgroupManager.Setup())
@@ -458,7 +458,7 @@ func TestPruneOldCgroupsV2(t *testing.T) {
setup: func(t *testing.T, cfg cgroups.Config, mock *mockCgroupV2) int {
pid := os.Getpid()
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), pid)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), pid)
mock.setupMockCgroupFiles(t, cgroupManager)
require.NoError(t, cgroupManager.Setup())
@@ -477,7 +477,7 @@ func TestPruneOldCgroupsV2(t *testing.T) {
},
},
setup: func(t *testing.T, cfg cgroups.Config, mock *mockCgroupV2) int {
- cgroupManager := mock.newCgroupManager(cfg, testhelper.NewLogger(t), 0)
+ cgroupManager := mock.newCgroupManager(cfg, testhelper.SharedLogger(t), 0)
mock.setupMockCgroupFiles(t, cgroupManager)
require.NoError(t, cgroupManager.Setup())
@@ -571,7 +571,7 @@ throttled_usec 1000000`}, // 0.001 seconds
config.Repositories.CPUShares = 16
config.Mountpoint = mock.root
- v2Manager := mock.newCgroupManager(config, testhelper.NewLogger(t), 1)
+ v2Manager := mock.newCgroupManager(config, testhelper.SharedLogger(t), 1)
mock.setupMockCgroupFiles(t, v2Manager, tc.mockFiles...)
require.NoError(t, v2Manager.Setup())
diff --git a/internal/cli/praefect/subcmd_remove_repository_test.go b/internal/cli/praefect/subcmd_remove_repository_test.go
index 0568a1549..489524e36 100644
--- a/internal/cli/praefect/subcmd_remove_repository_test.go
+++ b/internal/cli/praefect/subcmd_remove_repository_test.go
@@ -371,7 +371,7 @@ func TestRemoveRepository_removeReplicationEvents(t *testing.T) {
}()
cmd := &removeRepository{virtualStorage: virtualStorage, relativePath: relativePath}
- require.NoError(t, cmd.removeReplicationEvents(ctx, testhelper.NewLogger(t), db.DB, ticker))
+ require.NoError(t, cmd.removeReplicationEvents(ctx, testhelper.SharedLogger(t), db.DB, ticker))
wg.Wait()
diff --git a/internal/cli/praefect/subcmd_track_repositories_test.go b/internal/cli/praefect/subcmd_track_repositories_test.go
index 7a84b6b5f..d5371a32c 100644
--- a/internal/cli/praefect/subcmd_track_repositories_test.go
+++ b/internal/cli/praefect/subcmd_track_repositories_test.go
@@ -87,7 +87,7 @@ func TestTrackRepositoriesSubcommand(t *testing.T) {
authoritativeStorage := g1Cfg.Storages[0].Name
nodeMgr, err := nodes.NewManager(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
conf,
db.DB,
nil,
diff --git a/internal/cli/praefect/subcmd_track_repository_test.go b/internal/cli/praefect/subcmd_track_repository_test.go
index 28433d16f..bd10b3411 100644
--- a/internal/cli/praefect/subcmd_track_repository_test.go
+++ b/internal/cli/praefect/subcmd_track_repository_test.go
@@ -210,7 +210,7 @@ func TestTrackRepositorySubcommand(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.desc, func(t *testing.T) {
nodeMgr, err := nodes.NewManager(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
conf,
db.DB,
nil,
diff --git a/internal/dontpanic/retry_test.go b/internal/dontpanic/retry_test.go
index 0ace43943..ff65c39ca 100644
--- a/internal/dontpanic/retry_test.go
+++ b/internal/dontpanic/retry_test.go
@@ -10,18 +10,18 @@ import (
)
func TestTry(t *testing.T) {
- dontpanic.Try(testhelper.NewLogger(t), func() { panic("don't panic") })
+ dontpanic.Try(testhelper.SharedLogger(t), func() { panic("don't panic") })
}
func TestTryNoPanic(t *testing.T) {
invoked := false
- dontpanic.Try(testhelper.NewLogger(t), func() { invoked = true })
+ dontpanic.Try(testhelper.SharedLogger(t), func() { invoked = true })
require.True(t, invoked)
}
func TestGo(t *testing.T) {
done := make(chan struct{})
- dontpanic.Go(testhelper.NewLogger(t), func() {
+ dontpanic.Go(testhelper.SharedLogger(t), func() {
defer close(done)
panic("don't panic")
})
@@ -30,7 +30,7 @@ func TestGo(t *testing.T) {
func TestGoNoPanic(t *testing.T) {
done := make(chan struct{})
- dontpanic.Go(testhelper.NewLogger(t), func() { close(done) })
+ dontpanic.Go(testhelper.SharedLogger(t), func() { close(done) })
<-done
}
@@ -50,7 +50,7 @@ func TestGoForever(t *testing.T) {
panic("don't panic")
}
- forever := dontpanic.NewForever(testhelper.NewLogger(t), time.Microsecond)
+ forever := dontpanic.NewForever(testhelper.SharedLogger(t), time.Microsecond)
forever.Go(fn)
var actualPanics int
diff --git a/internal/git/command_factory_test.go b/internal/git/command_factory_test.go
index 09d9a2963..48d19bde3 100644
--- a/internal/git/command_factory_test.go
+++ b/internal/git/command_factory_test.go
@@ -45,7 +45,7 @@ func TestGitCommandProxy(t *testing.T) {
dir := testhelper.TempDir(t)
- gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t))
+ gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t))
require.NoError(t, err)
defer cleanup()
@@ -65,7 +65,7 @@ func TestGitCommandProxy(t *testing.T) {
func TestExecCommandFactory_globalGitConfigIgnored(t *testing.T) {
cfg := testcfg.Build(t)
- gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t))
+ gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t))
require.NoError(t, err)
defer cleanup()
@@ -111,7 +111,7 @@ func TestExecCommandFactory_gitConfiguration(t *testing.T) {
require.NoError(t, os.Remove(filepath.Join(repoPath, "config")))
defaultConfig := func() []string {
- commandFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t))
+ commandFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t))
require.NoError(t, err)
defer cleanup()
@@ -199,7 +199,7 @@ func TestExecCommandFactory_gitConfiguration(t *testing.T) {
t.Run(tc.desc, func(t *testing.T) {
cfg.Git.Config = tc.config
- commandFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t))
+ commandFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t))
require.NoError(t, err)
defer cleanup()
@@ -225,7 +225,7 @@ func TestCommandFactory_ExecutionEnvironment(t *testing.T) {
assertExecEnv := func(t *testing.T, cfg config.Cfg, expectedExecEnv git.ExecutionEnvironment) {
t.Helper()
- gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t), git.WithSkipHooks())
+ gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t), git.WithSkipHooks())
require.NoError(t, err)
defer cleanup()
@@ -388,7 +388,7 @@ func TestCommandFactory_ExecutionEnvironment(t *testing.T) {
config.Cfg{
BinDir: setupData.binaryDir,
},
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
git.WithSkipHooks(),
// Override the constructors so that we don't have to change
// tests every time we're upgrading our bundled Git version.
@@ -446,7 +446,7 @@ func TestCommandFactory_ExecutionEnvironment(t *testing.T) {
t.Run("doesn't exist in the system", func(t *testing.T) {
testhelper.Unsetenv(t, "PATH")
- _, _, err := git.NewExecCommandFactory(config.Cfg{}, testhelper.NewLogger(t), git.WithSkipHooks())
+ _, _, err := git.NewExecCommandFactory(config.Cfg{}, testhelper.SharedLogger(t), git.WithSkipHooks())
require.EqualError(t, err, "setting up Git execution environment: could not set up any Git execution environments")
})
}
@@ -684,7 +684,7 @@ func TestFsckConfiguration(t *testing.T) {
_, err := gittest.DefaultObjectHash.FromHex(text.ChompBytes(commitOut))
require.NoError(t, err)
- gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t))
+ gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t))
require.NoError(t, err)
defer cleanup()
@@ -966,7 +966,7 @@ func TestTrace2PackObjectsMetrics(t *testing.T) {
repoProto, _ := gittest.CreateRepository(t, ctx, cfg,
gittest.CreateRepositoryConfig{SkipCreationViaService: true},
)
- gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t), opts...)
+ gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t), opts...)
require.NoError(t, err)
defer cleanup()
@@ -1086,7 +1086,7 @@ func performPackObjectGit(t *testing.T, ctx context.Context, opts ...git.ExecCom
input.WriteString("\n")
}
- gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t), opts...)
+ gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t), opts...)
require.NoError(t, err)
defer cleanup()
@@ -1109,7 +1109,7 @@ func performRevList(t *testing.T, ctx context.Context, opts ...git.ExecCommandFa
repoProto, _ := gittest.CreateRepository(t, ctx, cfg,
gittest.CreateRepositoryConfig{SkipCreationViaService: true},
)
- gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(t), opts...)
+ gitCmdFactory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(t), opts...)
require.NoError(t, err)
defer cleanup()
diff --git a/internal/git/gittest/command_factory.go b/internal/git/gittest/command_factory.go
index ae03454a7..8c4af980f 100644
--- a/internal/git/gittest/command_factory.go
+++ b/internal/git/gittest/command_factory.go
@@ -12,7 +12,7 @@ import (
// NewCommandFactory creates a new Git command factory.
func NewCommandFactory(tb testing.TB, cfg config.Cfg, opts ...git.ExecCommandFactoryOption) *git.ExecCommandFactory {
tb.Helper()
- factory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.NewLogger(tb), opts...)
+ factory, cleanup, err := git.NewExecCommandFactory(cfg, testhelper.SharedLogger(tb), opts...)
require.NoError(tb, err)
tb.Cleanup(cleanup)
return factory
diff --git a/internal/git/testhelper_test.go b/internal/git/testhelper_test.go
index 975542cbe..711de3aae 100644
--- a/internal/git/testhelper_test.go
+++ b/internal/git/testhelper_test.go
@@ -13,7 +13,7 @@ func TestMain(m *testing.M) {
}
func newCommandFactory(tb testing.TB, cfg config.Cfg, opts ...ExecCommandFactoryOption) *ExecCommandFactory {
- gitCmdFactory, cleanup, err := NewExecCommandFactory(cfg, testhelper.NewLogger(tb), opts...)
+ gitCmdFactory, cleanup, err := NewExecCommandFactory(cfg, testhelper.SharedLogger(tb), opts...)
require.NoError(tb, err)
tb.Cleanup(cleanup)
return gitCmdFactory
diff --git a/internal/gitaly/config/temp_dir_test.go b/internal/gitaly/config/temp_dir_test.go
index 676b6e8db..bb33d11a4 100644
--- a/internal/gitaly/config/temp_dir_test.go
+++ b/internal/gitaly/config/temp_dir_test.go
@@ -15,17 +15,17 @@ import (
func TestPruneOldGitalyProcessDirectories(t *testing.T) {
t.Run("no runtime directories", func(t *testing.T) {
- require.NoError(t, PruneOldGitalyProcessDirectories(testhelper.NewLogger(t), testhelper.TempDir(t)))
+ require.NoError(t, PruneOldGitalyProcessDirectories(testhelper.SharedLogger(t), testhelper.TempDir(t)))
})
t.Run("unset runtime directory", func(t *testing.T) {
require.EqualError(t,
- PruneOldGitalyProcessDirectories(testhelper.NewLogger(t), ""), "list gitaly process directory: open : no such file or directory")
+ PruneOldGitalyProcessDirectories(testhelper.SharedLogger(t), ""), "list gitaly process directory: open : no such file or directory")
})
t.Run("non-existent runtime directory", func(t *testing.T) {
require.EqualError(t,
- PruneOldGitalyProcessDirectories(testhelper.NewLogger(t),
+ PruneOldGitalyProcessDirectories(testhelper.SharedLogger(t),
"/path/does/not/exist"), "list gitaly process directory: open /path/does/not/exist: no such file or directory")
})
diff --git a/internal/gitaly/maintenance/daily_test.go b/internal/gitaly/maintenance/daily_test.go
index 1d79d0c60..1b4f0a21d 100644
--- a/internal/gitaly/maintenance/daily_test.go
+++ b/internal/gitaly/maintenance/daily_test.go
@@ -41,7 +41,7 @@ func TestStartDaily(t *testing.T) {
}
ctx, cancel := context.WithCancel(testhelper.Context(t))
- go func() { errQ <- dw.StartDaily(ctx, testhelper.NewLogger(t), s, fn) }()
+ go func() { errQ <- dw.StartDaily(ctx, testhelper.SharedLogger(t), s, fn) }()
startTime := time.Date(1999, 3, 31, 0, 0, 0, 0, time.Local)
for _, tt := range []struct {
diff --git a/internal/gitaly/maintenance/optimize_test.go b/internal/gitaly/maintenance/optimize_test.go
index 8c4117de5..5b94b2f98 100644
--- a/internal/gitaly/maintenance/optimize_test.go
+++ b/internal/gitaly/maintenance/optimize_test.go
@@ -109,7 +109,7 @@ func TestOptimizeReposRandomly(t *testing.T) {
}
walker := OptimizeReposRandomly(cfg, mo, ticker, rand.New(rand.NewSource(1)))
- require.NoError(t, walker(ctx, testhelper.NewLogger(t), tc.storages))
+ require.NoError(t, walker(ctx, testhelper.SharedLogger(t), tc.storages))
require.ElementsMatch(t, tc.expected, mo.actual)
require.True(t, tickerDone)
// We expect one more tick than optimized repositories because of the
diff --git a/internal/gitaly/server/auth_test.go b/internal/gitaly/server/auth_test.go
index d852fea33..0c90233e9 100644
--- a/internal/gitaly/server/auth_test.go
+++ b/internal/gitaly/server/auth_test.go
@@ -185,7 +185,7 @@ func newOperationClient(t *testing.T, token, serverSocketPath string) (gitalypb.
func runServer(t *testing.T, cfg config.Cfg) string {
t.Helper()
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
registry := backchannel.NewRegistry()
conns := client.NewPool()
t.Cleanup(func() { conns.Close() })
@@ -238,9 +238,9 @@ func runSecureServer(t *testing.T, cfg config.Cfg) string {
srv, err := NewGitalyServerFactory(
cfg,
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
backchannel.NewRegistry(),
- cache.New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t)),
+ cache.New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t)),
[]*limithandler.LimiterMiddleware{limithandler.New(cfg, limithandler.LimitConcurrencyByRepo, limithandler.WithConcurrencyLimiters)},
).New(true)
require.NoError(t, err)
diff --git a/internal/gitaly/server/server_factory_test.go b/internal/gitaly/server/server_factory_test.go
index f359f8480..2ca530e98 100644
--- a/internal/gitaly/server/server_factory_test.go
+++ b/internal/gitaly/server/server_factory_test.go
@@ -81,9 +81,9 @@ func TestGitalyServerFactory(t *testing.T) {
cfg := testcfg.Build(t)
sf := NewGitalyServerFactory(
cfg,
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
backchannel.NewRegistry(),
- cache.New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t)),
+ cache.New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t)),
nil,
)
t.Cleanup(sf.Stop)
@@ -101,9 +101,9 @@ func TestGitalyServerFactory(t *testing.T) {
sf := NewGitalyServerFactory(
cfg,
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
backchannel.NewRegistry(),
- cache.New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t)),
+ cache.New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t)),
nil,
)
t.Cleanup(sf.Stop)
@@ -115,9 +115,9 @@ func TestGitalyServerFactory(t *testing.T) {
cfg := testcfg.Build(t)
sf := NewGitalyServerFactory(
cfg,
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
backchannel.NewRegistry(),
- cache.New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t)),
+ cache.New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t)),
nil,
)
t.Cleanup(sf.Stop)
@@ -180,9 +180,9 @@ func TestGitalyServerFactory_closeOrder(t *testing.T) {
cfg := testcfg.Build(t)
sf := NewGitalyServerFactory(
cfg,
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
backchannel.NewRegistry(),
- cache.New(cfg, config.NewLocator(cfg), testhelper.NewLogger(t)),
+ cache.New(cfg, config.NewLocator(cfg), testhelper.SharedLogger(t)),
nil,
)
defer sf.Stop()
diff --git a/internal/gitaly/service/hook/post_receive_test.go b/internal/gitaly/service/hook/post_receive_test.go
index dd5565563..d84a0f3b8 100644
--- a/internal/gitaly/service/hook/post_receive_test.go
+++ b/internal/gitaly/service/hook/post_receive_test.go
@@ -96,7 +96,7 @@ func TestHooksMissingStdin(t *testing.T) {
},
}
- gitlabClient, err := gitlab.NewHTTPClient(testhelper.NewLogger(t), cfg.Gitlab, cfg.TLS, prometheus.Config{})
+ gitlabClient, err := gitlab.NewHTTPClient(testhelper.SharedLogger(t), cfg.Gitlab, cfg.TLS, prometheus.Config{})
require.NoError(t, err)
txManager := transaction.NewTrackingManager()
@@ -236,7 +236,7 @@ To create a merge request for okay, visit:
},
}
- gitlabClient, err := gitlab.NewHTTPClient(testhelper.NewLogger(t), cfg.Gitlab, cfg.TLS, prometheus.Config{})
+ gitlabClient, err := gitlab.NewHTTPClient(testhelper.SharedLogger(t), cfg.Gitlab, cfg.TLS, prometheus.Config{})
require.NoError(t, err)
serverSocketPath := runHooksServer(t, cfg, nil, testserver.WithGitLabClient(gitlabClient))
diff --git a/internal/gitaly/service/hook/pre_receive_test.go b/internal/gitaly/service/hook/pre_receive_test.go
index b6713df59..6131e909f 100644
--- a/internal/gitaly/service/hook/pre_receive_test.go
+++ b/internal/gitaly/service/hook/pre_receive_test.go
@@ -137,7 +137,7 @@ func TestPreReceiveHook_GitlabAPIAccess(t *testing.T) {
SecretFile: secretFilePath,
}
- gitlabClient, err := gitlab.NewHTTPClient(testhelper.NewLogger(t), gitlabConfig, cfg.TLS, prometheus.Config{})
+ gitlabClient, err := gitlab.NewHTTPClient(testhelper.SharedLogger(t), gitlabConfig, cfg.TLS, prometheus.Config{})
require.NoError(t, err)
serverSocketPath := runHooksServer(t, cfg, nil, testserver.WithGitLabClient(gitlabClient))
@@ -255,7 +255,7 @@ func TestPreReceive_APIErrors(t *testing.T) {
SecretFile: secretFilePath,
}
- gitlabClient, err := gitlab.NewHTTPClient(testhelper.NewLogger(t), gitlabConfig, cfg.TLS, prometheus.Config{})
+ gitlabClient, err := gitlab.NewHTTPClient(testhelper.SharedLogger(t), gitlabConfig, cfg.TLS, prometheus.Config{})
require.NoError(t, err)
cfg.SocketPath = runHooksServer(t, cfg, nil, testserver.WithGitLabClient(gitlabClient))
@@ -320,7 +320,7 @@ func TestPreReceiveHook_CustomHookErrors(t *testing.T) {
SecretFile: secretFilePath,
}
- gitlabClient, err := gitlab.NewHTTPClient(testhelper.NewLogger(t), gitlabConfig, cfg.TLS, prometheus.Config{})
+ gitlabClient, err := gitlab.NewHTTPClient(testhelper.SharedLogger(t), gitlabConfig, cfg.TLS, prometheus.Config{})
require.NoError(t, err)
cfg.SocketPath = runHooksServer(t, cfg, nil, testserver.WithGitLabClient(gitlabClient))
@@ -465,7 +465,7 @@ func TestPreReceiveHook_Primary(t *testing.T) {
gitlab.WriteShellSecretFile(t, tmpDir, "token")
gitlabClient, err := gitlab.NewHTTPClient(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
config.Gitlab{
URL: srv.URL,
SecretFile: secretFilePath,
diff --git a/internal/gitaly/service/objectpool/fetch_into_object_pool_test.go b/internal/gitaly/service/objectpool/fetch_into_object_pool_test.go
index 017c6f1d9..edbcd00dc 100644
--- a/internal/gitaly/service/objectpool/fetch_into_object_pool_test.go
+++ b/internal/gitaly/service/objectpool/fetch_into_object_pool_test.go
@@ -100,7 +100,7 @@ func TestFetchIntoObjectPool_transactional(t *testing.T) {
cfg := testcfg.Build(t)
cfg.SocketPath = runObjectPoolServer(
t, cfg, config.NewLocator(cfg),
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
testserver.WithTransactionManager(&txManager),
// We need to disable Praefect given that we replace transactions with our own logic
// here.
diff --git a/internal/gitaly/service/objectpool/testhelper_test.go b/internal/gitaly/service/objectpool/testhelper_test.go
index 627c293ae..48a5e2967 100644
--- a/internal/gitaly/service/objectpool/testhelper_test.go
+++ b/internal/gitaly/service/objectpool/testhelper_test.go
@@ -50,7 +50,7 @@ func setupWithConfig(t *testing.T, ctx context.Context, cfg config.Cfg, opts ...
testcfg.BuildGitalyHooks(t, cfg)
locator := config.NewLocator(cfg)
- cfg.SocketPath = runObjectPoolServer(t, cfg, locator, testhelper.NewLogger(t), opts...)
+ cfg.SocketPath = runObjectPoolServer(t, cfg, locator, testhelper.SharedLogger(t), opts...)
conn, err := grpc.Dial(cfg.SocketPath, grpc.WithTransportCredentials(insecure.NewCredentials()))
require.NoError(t, err)
diff --git a/internal/gitaly/service/operations/tags_test.go b/internal/gitaly/service/operations/tags_test.go
index 1d2088a60..ac83210a3 100644
--- a/internal/gitaly/service/operations/tags_test.go
+++ b/internal/gitaly/service/operations/tags_test.go
@@ -469,7 +469,7 @@ func TestUserCreateTag_transactional(t *testing.T) {
// to Gitaly directly.
client := newMuxedOperationClient(t, ctx, "unix://"+cfg.InternalSocketPath(), cfg.Auth.Token,
backchannel.NewClientHandshaker(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
func() backchannel.Server {
srv := grpc.NewServer()
gitalypb.RegisterRefTransactionServer(srv, transactionServer)
diff --git a/internal/gitaly/service/operations/user_create_branch_test.go b/internal/gitaly/service/operations/user_create_branch_test.go
index 63b881d4d..5fdd93f16 100644
--- a/internal/gitaly/service/operations/user_create_branch_test.go
+++ b/internal/gitaly/service/operations/user_create_branch_test.go
@@ -169,7 +169,7 @@ func TestUserCreateBranch_transactions(t *testing.T) {
client := newMuxedOperationClient(t, ctx, tc.address, cfg.Auth.Token,
backchannel.NewClientHandshaker(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
func() backchannel.Server {
srv := grpc.NewServer()
gitalypb.RegisterRefTransactionServer(srv, transactionServer)
diff --git a/internal/gitaly/service/operations/user_delete_branch_test.go b/internal/gitaly/service/operations/user_delete_branch_test.go
index 2eac81ee3..686778e0a 100644
--- a/internal/gitaly/service/operations/user_delete_branch_test.go
+++ b/internal/gitaly/service/operations/user_delete_branch_test.go
@@ -465,7 +465,7 @@ func TestUserDeleteBranch_transaction(t *testing.T) {
client := newMuxedOperationClient(t, ctx, fmt.Sprintf("unix://"+cfg.InternalSocketPath()), cfg.Auth.Token,
backchannel.NewClientHandshaker(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
func() backchannel.Server {
srv := grpc.NewServer()
gitalypb.RegisterRefTransactionServer(srv, transactionServer)
diff --git a/internal/gitaly/service/repository/apply_gitattributes_test.go b/internal/gitaly/service/repository/apply_gitattributes_test.go
index 318b760b8..246672a8c 100644
--- a/internal/gitaly/service/repository/apply_gitattributes_test.go
+++ b/internal/gitaly/service/repository/apply_gitattributes_test.go
@@ -109,7 +109,7 @@ func TestApplyGitattributes_transactional(t *testing.T) {
// We're using internal listener in order to route around
// Praefect in our tests. Otherwise Praefect would replace our
// carefully crafted transaction and server information.
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
client := newMuxedRepositoryClient(t, ctx, cfg, "unix://"+cfg.InternalSocketPath(),
backchannel.NewClientHandshaker(
diff --git a/internal/gitaly/service/repository/replicate_test.go b/internal/gitaly/service/repository/replicate_test.go
index 17321c48d..2c79163ef 100644
--- a/internal/gitaly/service/repository/replicate_test.go
+++ b/internal/gitaly/service/repository/replicate_test.go
@@ -723,7 +723,7 @@ func testReplicateRepositoryTransactional(t *testing.T, ctx context.Context) {
ctx = testhelper.MergeOutgoingMetadata(ctx, testcfg.GitalyServersMetadataFromCfg(t, cfg))
client := newMuxedRepositoryClient(t, ctx, cfg, serverSocketPath, backchannel.NewClientHandshaker(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
func() backchannel.Server {
srv := grpc.NewServer()
gitalypb.RegisterRefTransactionServer(srv, &txServer)
diff --git a/internal/gitaly/service/smarthttp/inforefs_test.go b/internal/gitaly/service/smarthttp/inforefs_test.go
index d202d63a2..c4793d019 100644
--- a/internal/gitaly/service/smarthttp/inforefs_test.go
+++ b/internal/gitaly/service/smarthttp/inforefs_test.go
@@ -398,7 +398,7 @@ func TestInfoRefsUploadPack_cache(t *testing.T) {
cfg := testcfg.Build(t)
locator := config.NewLocator(cfg)
- cache := cache.New(cfg, locator, testhelper.NewLogger(t))
+ cache := cache.New(cfg, locator, testhelper.SharedLogger(t))
streamer := mockStreamer{
Streamer: cache,
diff --git a/internal/gitaly/service/smarthttp/testhelper_test.go b/internal/gitaly/service/smarthttp/testhelper_test.go
index 36169a2b7..451043ea5 100644
--- a/internal/gitaly/service/smarthttp/testhelper_test.go
+++ b/internal/gitaly/service/smarthttp/testhelper_test.go
@@ -96,7 +96,7 @@ func newMuxedSmartHTTPClient(t *testing.T, ctx context.Context, serverSocketPath
ctx,
serverSocketPath,
client.WithGrpcOptions([]grpc.DialOption{grpc.WithPerRPCCredentials(gitalyauth.RPCCredentialsV2(token))}),
- client.WithHandshaker(backchannel.NewClientHandshaker(testhelper.NewLogger(t), serverFactory, backchannel.DefaultConfiguration())),
+ client.WithHandshaker(backchannel.NewClientHandshaker(testhelper.SharedLogger(t), serverFactory, backchannel.DefaultConfiguration())),
)
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, conn.Close()) })
diff --git a/internal/gitaly/service/smarthttp/upload_pack_test.go b/internal/gitaly/service/smarthttp/upload_pack_test.go
index 7e09d98c5..b9769a7b3 100644
--- a/internal/gitaly/service/smarthttp/upload_pack_test.go
+++ b/internal/gitaly/service/smarthttp/upload_pack_test.go
@@ -480,7 +480,7 @@ func testServerPostUploadPackAllowAnySHA1InWant(t *testing.T, ctx context.Contex
func dialSmartHTTPServerWithSidechannel(t *testing.T, serverSocketPath, token string, registry *sidechannel.Registry) *grpc.ClientConn {
t.Helper()
- clientHandshaker := sidechannel.NewClientHandshaker(testhelper.NewLogger(t), registry)
+ clientHandshaker := sidechannel.NewClientHandshaker(testhelper.SharedLogger(t), registry)
connOpts := []grpc.DialOption{
grpc.WithTransportCredentials(clientHandshaker.ClientHandshake(insecure.NewCredentials())),
grpc.WithPerRPCCredentials(gitalyauth.RPCCredentialsV2(token)),
diff --git a/internal/gitaly/service/ssh/upload_pack_test.go b/internal/gitaly/service/ssh/upload_pack_test.go
index e906089fe..328337f0d 100644
--- a/internal/gitaly/service/ssh/upload_pack_test.go
+++ b/internal/gitaly/service/ssh/upload_pack_test.go
@@ -166,7 +166,7 @@ func TestUploadPackWithSidechannel_client(t *testing.T) {
commitID := gittest.WriteCommit(t, cfg, repoPath, gittest.WithBranch(git.DefaultBranch))
registry := sidechannel.NewRegistry()
- clientHandshaker := sidechannel.NewClientHandshaker(testhelper.NewLogger(t), registry)
+ clientHandshaker := sidechannel.NewClientHandshaker(testhelper.SharedLogger(t), registry)
conn, err := grpc.Dial(cfg.SocketPath,
grpc.WithTransportCredentials(clientHandshaker.ClientHandshake(insecure.NewCredentials())),
grpc.WithPerRPCCredentials(gitalyauth.RPCCredentialsV2(cfg.Auth.Token)),
diff --git a/internal/gitaly/storage/counter/counter_test.go b/internal/gitaly/storage/counter/counter_test.go
index df3967412..24c89c7ba 100644
--- a/internal/gitaly/storage/counter/counter_test.go
+++ b/internal/gitaly/storage/counter/counter_test.go
@@ -109,7 +109,7 @@ func TestCountStorages(t *testing.T) {
ctx := testhelper.Context(t)
cfg := testcfg.Build(t, testcfg.WithStorages(tc.storageNames[0], tc.storageNames[1:]...))
locator := config.NewLocator(cfg)
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
if tc.sharedPath {
cfg.Storages[1].Path = cfg.Storages[0].Path
diff --git a/internal/gitaly/storage/storagemgr/partition_assigner_test.go b/internal/gitaly/storage/storagemgr/partition_assigner_test.go
index 121dd4a74..fb8a05b1e 100644
--- a/internal/gitaly/storage/storagemgr/partition_assigner_test.go
+++ b/internal/gitaly/storage/storagemgr/partition_assigner_test.go
@@ -11,7 +11,7 @@ import (
)
func TestPartitionAssigner(t *testing.T) {
- db, err := OpenDatabase(testhelper.NewLogger(t), t.TempDir())
+ db, err := OpenDatabase(testhelper.SharedLogger(t), t.TempDir())
require.NoError(t, err)
defer testhelper.MustClose(t, db)
@@ -42,7 +42,7 @@ func TestPartitionAssigner(t *testing.T) {
func TestPartitionAssigner_close(t *testing.T) {
dbDir := t.TempDir()
- db, err := OpenDatabase(testhelper.NewLogger(t), dbDir)
+ db, err := OpenDatabase(testhelper.SharedLogger(t), dbDir)
require.NoError(t, err)
pa, err := newPartitionAssigner(db)
@@ -50,7 +50,7 @@ func TestPartitionAssigner_close(t *testing.T) {
testhelper.MustClose(t, pa)
testhelper.MustClose(t, db)
- db, err = OpenDatabase(testhelper.NewLogger(t), dbDir)
+ db, err = OpenDatabase(testhelper.SharedLogger(t), dbDir)
require.NoError(t, err)
defer testhelper.MustClose(t, db)
@@ -67,7 +67,7 @@ func TestPartitionAssigner_close(t *testing.T) {
}
func TestPartitionAssigner_concurrentAccess(t *testing.T) {
- db, err := OpenDatabase(testhelper.NewLogger(t), t.TempDir())
+ db, err := OpenDatabase(testhelper.SharedLogger(t), t.TempDir())
require.NoError(t, err)
defer testhelper.MustClose(t, db)
diff --git a/internal/gitaly/storage/storagemgr/partition_manager_test.go b/internal/gitaly/storage/storagemgr/partition_manager_test.go
index f93f4744c..dc0a596bf 100644
--- a/internal/gitaly/storage/storagemgr/partition_manager_test.go
+++ b/internal/gitaly/storage/storagemgr/partition_manager_test.go
@@ -616,7 +616,7 @@ func TestPartitionManager(t *testing.T) {
txManager := transaction.NewManager(cfg, backchannel.NewRegistry())
housekeepingManager := housekeeping.NewManager(cfg.Prometheus, txManager)
- partitionManager, err := NewPartitionManager(cfg.Storages, cmdFactory, housekeepingManager, localRepoFactory, testhelper.NewLogger(t))
+ partitionManager, err := NewPartitionManager(cfg.Storages, cmdFactory, housekeepingManager, localRepoFactory, testhelper.SharedLogger(t))
require.NoError(t, err)
defer func() {
diff --git a/internal/gitaly/storage/storagemgr/transaction_manager_test.go b/internal/gitaly/storage/storagemgr/transaction_manager_test.go
index bd4ce206c..3d9897242 100644
--- a/internal/gitaly/storage/storagemgr/transaction_manager_test.go
+++ b/internal/gitaly/storage/storagemgr/transaction_manager_test.go
@@ -3643,7 +3643,7 @@ func TestTransactionManager(t *testing.T) {
repoPath, err := repo.Path()
require.NoError(t, err)
- database, err := OpenDatabase(testhelper.NewLogger(t), t.TempDir())
+ database, err := OpenDatabase(testhelper.SharedLogger(t), t.TempDir())
require.NoError(t, err)
defer testhelper.MustClose(t, database)
@@ -4038,7 +4038,7 @@ func BenchmarkTransactionManager(b *testing.B) {
cache := catfile.NewCache(cfg)
defer cache.Stop()
- database, err := OpenDatabase(testhelper.NewLogger(b), b.TempDir())
+ database, err := OpenDatabase(testhelper.SharedLogger(b), b.TempDir())
require.NoError(b, err)
defer testhelper.MustClose(b, database)
diff --git a/internal/gitlab/client/gitlabnet_test.go b/internal/gitlab/client/gitlabnet_test.go
index 88ea791f9..fe3b8fd04 100644
--- a/internal/gitlab/client/gitlabnet_test.go
+++ b/internal/gitlab/client/gitlabnet_test.go
@@ -47,7 +47,7 @@ func TestJWTAuthenticationHeader(t *testing.T) {
for _, tc := range tests {
t.Run(tc.method+" with "+tc.secret, func(t *testing.T) {
gitlabnet, err := NewGitlabNetClient(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
"user",
"password",
tc.secret,
diff --git a/internal/gitlab/http_client_test.go b/internal/gitlab/http_client_test.go
index 95a1ea641..3d9ab7137 100644
--- a/internal/gitlab/http_client_test.go
+++ b/internal/gitlab/http_client_test.go
@@ -81,7 +81,7 @@ func TestAccess_verifyParams(t *testing.T) {
defer cleanup()
c, err := NewHTTPClient(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
config.Gitlab{
URL: serverURL,
SecretFile: secretFilePath,
@@ -227,7 +227,7 @@ func TestAccess_escapedAndRelativeURLs(t *testing.T) {
}
c, err := NewHTTPClient(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
config.Gitlab{
URL: serverURL,
RelativeURLRoot: tc.relativeURLRoot,
@@ -386,7 +386,7 @@ func TestAccess_allowedResponseHandling(t *testing.T) {
defer server.Close()
c, err := NewHTTPClient(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
config.Gitlab{
URL: server.URL,
SecretFile: secretFilePath,
@@ -496,7 +496,7 @@ func TestAccess_preReceive(t *testing.T) {
defer server.Close()
c, err := NewHTTPClient(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
config.Gitlab{
URL: server.URL,
SecretFile: secretFilePath,
@@ -585,7 +585,7 @@ func TestAccess_postReceive(t *testing.T) {
defer server.Close()
c, err := NewHTTPClient(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
config.Gitlab{
URL: server.URL,
SecretFile: secretFilePath,
@@ -662,7 +662,7 @@ func TestNewHTTPClient_gitlabSecretConfig(t *testing.T) {
defer server.Close()
httpClient, err := NewHTTPClient(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
config.Gitlab{
URL: server.URL,
Secret: tc.secret,
diff --git a/internal/grpc/backchannel/backchannel_test.go b/internal/grpc/backchannel/backchannel_test.go
index 5f50f4aed..6791f944a 100644
--- a/internal/grpc/backchannel/backchannel_test.go
+++ b/internal/grpc/backchannel/backchannel_test.go
@@ -35,7 +35,7 @@ func TestBackchannel_concurrentRequestsFromMultipleClients(t *testing.T) {
registry := NewRegistry()
lm := listenmux.New(insecure.NewCredentials())
lm.Register(NewServerHandshaker(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
registry,
[]grpc.DialOption{
grpc.WithUnaryInterceptor(func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
@@ -102,7 +102,7 @@ func TestBackchannel_concurrentRequestsFromMultipleClients(t *testing.T) {
expectedErr := status.Error(codes.Internal, fmt.Sprintf("multiplexed %d", i))
- clientHandshaker := NewClientHandshaker(testhelper.NewLogger(t), func() Server {
+ clientHandshaker := NewClientHandshaker(testhelper.SharedLogger(t), func() Server {
srv := grpc.NewServer()
gitalypb.RegisterRefTransactionServer(srv, mockTransactionServer{
voteTransactionFunc: func(ctx context.Context, req *gitalypb.VoteTransactionRequest) (*gitalypb.VoteTransactionResponse, error) {
@@ -162,7 +162,7 @@ func TestHandshaker_idempotentClose(t *testing.T) {
stopCalled := 0
stopServing := make(chan struct{})
serverErr := errors.New("serve error")
- clientHandshaker := NewClientHandshaker(testhelper.NewLogger(t), func() Server {
+ clientHandshaker := NewClientHandshaker(testhelper.SharedLogger(t), func() Server {
return mockServer{
serveFunc: func(ln net.Listener) error {
<-stopServing
@@ -187,7 +187,7 @@ func TestHandshaker_idempotentClose(t *testing.T) {
assert.Equal(t, magicBytes, magic)
conn, _, err := NewServerHandshaker(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
NewRegistry(),
nil,
).Handshake(serverPipe, nil)
@@ -239,7 +239,7 @@ func Benchmark(b *testing.B) {
var serverOpts []grpc.ServerOption
if tc.multiplexed {
lm := listenmux.New(insecure.NewCredentials())
- lm.Register(NewServerHandshaker(testhelper.NewLogger(b), NewRegistry(), nil))
+ lm.Register(NewServerHandshaker(testhelper.SharedLogger(b), NewRegistry(), nil))
serverOpts = []grpc.ServerOption{
grpc.Creds(lm),
}
@@ -267,7 +267,7 @@ func Benchmark(b *testing.B) {
opts := []grpc.DialOption{grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials())}
if tc.multiplexed {
- clientHandshaker := NewClientHandshaker(testhelper.NewLogger(b), func() Server { return grpc.NewServer() }, DefaultConfiguration())
+ clientHandshaker := NewClientHandshaker(testhelper.SharedLogger(b), func() Server { return grpc.NewServer() }, DefaultConfiguration())
opts = []grpc.DialOption{
grpc.WithBlock(),
grpc.WithTransportCredentials(clientHandshaker.ClientHandshake(insecure.NewCredentials())),
diff --git a/internal/grpc/client/dial_test.go b/internal/grpc/client/dial_test.go
index b1fe22bbb..7036d2a90 100644
--- a/internal/grpc/client/dial_test.go
+++ b/internal/grpc/client/dial_test.go
@@ -20,7 +20,7 @@ func TestDial(t *testing.T) {
errNonMuxed := status.Error(codes.Internal, "non-muxed connection")
errMuxed := status.Error(codes.Internal, "muxed connection")
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
lm := listenmux.New(insecure.NewCredentials())
lm.Register(backchannel.NewServerHandshaker(logger, backchannel.NewRegistry(), nil))
diff --git a/internal/grpc/dnsresolver/builder_test.go b/internal/grpc/dnsresolver/builder_test.go
index 6b1c2c16e..b3741d1ae 100644
--- a/internal/grpc/dnsresolver/builder_test.go
+++ b/internal/grpc/dnsresolver/builder_test.go
@@ -72,7 +72,7 @@ func TestBuildDNSBuilder_customAuthorityResolver(t *testing.T) {
builder := NewBuilder(&BuilderConfig{
RefreshRate: 0,
LookupTimeout: 15 * time.Second,
- Logger: testhelper.NewLogger(t),
+ Logger: testhelper.SharedLogger(t),
Backoff: &fakeBackoff{},
})
@@ -119,7 +119,7 @@ func TestBuildDNSBuilder_staticIPAddress(t *testing.T) {
builder := NewBuilder(&BuilderConfig{
RefreshRate: 0,
LookupTimeout: 15 * time.Second,
- Logger: testhelper.NewLogger(t),
+ Logger: testhelper.SharedLogger(t),
Backoff: &fakeBackoff{},
})
diff --git a/internal/grpc/dnsresolver/resolver_test.go b/internal/grpc/dnsresolver/resolver_test.go
index 496ae7cce..1cbef27d9 100644
--- a/internal/grpc/dnsresolver/resolver_test.go
+++ b/internal/grpc/dnsresolver/resolver_test.go
@@ -298,7 +298,7 @@ func TestDnsResolver(t *testing.T) {
builder := NewBuilder(&BuilderConfig{
RefreshRate: 0, // No delay
LookupTimeout: 15 * time.Second,
- Logger: testhelper.NewLogger(t),
+ Logger: testhelper.SharedLogger(t),
DefaultGrpcPort: "1234",
Backoff: &fakeBackoff{},
})
@@ -345,7 +345,7 @@ func TestDnsResolver_grpcCallWithOurDNSResolver(t *testing.T) {
grpc.WithResolvers(NewBuilder(&BuilderConfig{
RefreshRate: 0, // No delay
LookupTimeout: 500 * time.Millisecond,
- Logger: testhelper.NewLogger(t),
+ Logger: testhelper.SharedLogger(t),
DefaultGrpcPort: "1234",
Backoff: backoff.NewDefaultExponential(rand.New(rand.NewSource(time.Now().UnixNano()))),
})),
diff --git a/internal/grpc/dnsresolver/testhelper_test.go b/internal/grpc/dnsresolver/testhelper_test.go
index ffe2ffb81..3abd3d645 100644
--- a/internal/grpc/dnsresolver/testhelper_test.go
+++ b/internal/grpc/dnsresolver/testhelper_test.go
@@ -125,7 +125,7 @@ func newTestDNSBuilder(t *testing.T) *Builder {
return NewBuilder(&BuilderConfig{
RefreshRate: 0,
LookupTimeout: 10 * time.Second,
- Logger: testhelper.NewLogger(t),
+ Logger: testhelper.SharedLogger(t),
Backoff: &fakeBackoff{},
})
}
diff --git a/internal/grpc/middleware/cache/cache_test.go b/internal/grpc/middleware/cache/cache_test.go
index ba9731f7c..6361eeadd 100644
--- a/internal/grpc/middleware/cache/cache_test.go
+++ b/internal/grpc/middleware/cache/cache_test.go
@@ -111,8 +111,8 @@ func TestInvalidators(t *testing.T) {
mockCache := newMockCache()
server := grpc.NewServer(
- grpc.StreamInterceptor(StreamInvalidator(mockCache, protoregistry.GitalyProtoPreregistered, testhelper.NewLogger(t))),
- grpc.UnaryInterceptor(UnaryInvalidator(mockCache, protoregistry.GitalyProtoPreregistered, testhelper.NewLogger(t))),
+ grpc.StreamInterceptor(StreamInvalidator(mockCache, protoregistry.GitalyProtoPreregistered, testhelper.SharedLogger(t))),
+ grpc.UnaryInterceptor(UnaryInvalidator(mockCache, protoregistry.GitalyProtoPreregistered, testhelper.SharedLogger(t))),
)
service := &testService{
diff --git a/internal/grpc/sidechannel/proxy_test.go b/internal/grpc/sidechannel/proxy_test.go
index 2b0582e04..38b64135f 100644
--- a/internal/grpc/sidechannel/proxy_test.go
+++ b/internal/grpc/sidechannel/proxy_test.go
@@ -116,7 +116,7 @@ func dialProxy(tb testing.TB, upstreamAddr string) (*grpc.ClientConn, error) {
return grpc.NewServer(grpc.Creds(lm))
}
- clientHandshaker := backchannel.NewClientHandshaker(testhelper.NewLogger(tb), factory, backchannel.DefaultConfiguration())
+ clientHandshaker := backchannel.NewClientHandshaker(testhelper.SharedLogger(tb), factory, backchannel.DefaultConfiguration())
dialOpts := []grpc.DialOption{
grpc.WithTransportCredentials(clientHandshaker.ClientHandshake(insecure.NewCredentials())),
grpc.WithUnaryInterceptor(NewUnaryProxy(registry)),
@@ -189,7 +189,7 @@ func startStreamServer(t *testing.T, handler func(gitalypb.SSHService_SSHUploadP
lm := listenmux.New(insecure.NewCredentials())
lm.Register(backchannel.NewServerHandshaker(
- testhelper.NewLogger(t), backchannel.NewRegistry(), nil,
+ testhelper.SharedLogger(t), backchannel.NewRegistry(), nil,
))
srv := grpc.NewServer(grpc.Creds(lm))
diff --git a/internal/grpc/sidechannel/sidechannel_test.go b/internal/grpc/sidechannel/sidechannel_test.go
index aabca09c1..14a49afa6 100644
--- a/internal/grpc/sidechannel/sidechannel_test.go
+++ b/internal/grpc/sidechannel/sidechannel_test.go
@@ -150,7 +150,7 @@ func startServer(t *testing.T, th testHandler, opts ...grpc.ServerOption) string
t.Helper()
lm := listenmux.New(insecure.NewCredentials())
- lm.Register(backchannel.NewServerHandshaker(testhelper.NewLogger(t), backchannel.NewRegistry(), nil))
+ lm.Register(backchannel.NewServerHandshaker(testhelper.SharedLogger(t), backchannel.NewRegistry(), nil))
opts = append(opts, grpc.Creds(lm))
@@ -170,7 +170,7 @@ func startServer(t *testing.T, th testHandler, opts ...grpc.ServerOption) string
func dial(t *testing.T, addr string) (*grpc.ClientConn, *Registry) {
registry := NewRegistry()
- clientHandshaker := NewClientHandshaker(testhelper.NewLogger(t), registry)
+ clientHandshaker := NewClientHandshaker(testhelper.SharedLogger(t), registry)
dialOpt := grpc.WithTransportCredentials(clientHandshaker.ClientHandshake(insecure.NewCredentials()))
conn, err := grpc.Dial(addr, dialOpt)
diff --git a/internal/limiter/adaptive_calculator_test.go b/internal/limiter/adaptive_calculator_test.go
index e475cd0fa..3cc106539 100644
--- a/internal/limiter/adaptive_calculator_test.go
+++ b/internal/limiter/adaptive_calculator_test.go
@@ -19,7 +19,7 @@ import (
func TestAdaptiveCalculator_alreadyStarted(t *testing.T) {
t.Parallel()
- calculator := NewAdaptiveCalculator(10*time.Millisecond, testhelper.NewLogger(t), nil, nil)
+ calculator := NewAdaptiveCalculator(10*time.Millisecond, testhelper.SharedLogger(t), nil, nil)
stop, err := calculator.Start(testhelper.Context(t))
require.NoError(t, err)
diff --git a/internal/praefect/auth_test.go b/internal/praefect/auth_test.go
index 4fb9f8ce6..05175754c 100644
--- a/internal/praefect/auth_test.go
+++ b/internal/praefect/auth_test.go
@@ -149,7 +149,7 @@ func runServer(t *testing.T, token string, required bool) (*grpc.Server, string,
},
},
}
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
queue := datastore.NewPostgresReplicationEventQueue(testdb.New(t))
nodeMgr, err := nodes.NewManager(logger, conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
diff --git a/internal/praefect/coordinator_test.go b/internal/praefect/coordinator_test.go
index b1a7b16a1..8bc5beeeb 100644
--- a/internal/praefect/coordinator_test.go
+++ b/internal/praefect/coordinator_test.go
@@ -462,7 +462,7 @@ func TestStreamDirectorMutator_StopTransaction(t *testing.T) {
RelativePath: "/path/to/hashed/storage",
}
- nodeMgr, err := nodes.NewManager(testhelper.NewLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nodeMgr, err := nodes.NewManager(testhelper.SharedLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
nodeMgr.Start(0, time.Hour)
defer nodeMgr.Stop()
@@ -575,7 +575,7 @@ func TestStreamDirectorMutator_SecondaryErrorHandling(t *testing.T) {
RelativePath: "/path/to/hashed/storage",
}
- nodeMgr, err := nodes.NewManager(testhelper.NewLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nodeMgr, err := nodes.NewManager(testhelper.SharedLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
nodeMgr.Start(0, time.Hour)
defer nodeMgr.Stop()
@@ -669,7 +669,7 @@ func TestStreamDirectorMutator_ReplicateRepository(t *testing.T) {
},
}
- nodeMgr, err := nodes.NewManager(testhelper.NewLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nodeMgr, err := nodes.NewManager(testhelper.SharedLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
nodeMgr.Start(0, time.Hour)
defer nodeMgr.Stop()
@@ -1059,7 +1059,7 @@ func TestStreamDirectorAccessor(t *testing.T) {
}
ctx := testhelper.Context(t)
- entry := testhelper.NewLogger(t)
+ entry := testhelper.SharedLogger(t)
rs := datastore.MockRepositoryStore{}
nodeMgr, err := nodes.NewManager(entry, conf, nil, rs, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
@@ -1164,7 +1164,7 @@ func TestCoordinatorStreamDirector_distributesReads(t *testing.T) {
}
ctx := testhelper.Context(t)
- entry := testhelper.NewLogger(t)
+ entry := testhelper.SharedLogger(t)
repoStore := datastore.MockRepositoryStore{
GetConsistentStoragesFunc: func(ctx context.Context, virtualStorage, relativePath string) (string, *datastructure.Set[string], error) {
@@ -1710,7 +1710,7 @@ func TestAbsentCorrelationID(t *testing.T) {
}
ctx := testhelper.Context(t)
- entry := testhelper.NewLogger(t)
+ entry := testhelper.SharedLogger(t)
nodeMgr, err := nodes.NewManager(entry, conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
@@ -1845,7 +1845,7 @@ func TestStreamDirectorStorageScope(t *testing.T) {
rs := datastore.MockRepositoryStore{}
- nodeMgr, err := nodes.NewManager(testhelper.NewLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nodeMgr, err := nodes.NewManager(testhelper.SharedLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
nodeMgr.Start(0, time.Second)
defer nodeMgr.Stop()
diff --git a/internal/praefect/datastore/collector_test.go b/internal/praefect/datastore/collector_test.go
index 72812995a..7add5a7e3 100644
--- a/internal/praefect/datastore/collector_test.go
+++ b/internal/praefect/datastore/collector_test.go
@@ -254,7 +254,7 @@ func TestRepositoryStoreCollector_ReplicationQueueDepth(t *testing.T) {
db := testdb.New(t)
ctx := testhelper.Context(t)
- log := testhelper.NewLogger(t)
+ log := testhelper.SharedLogger(t)
storageNames := map[string][]string{
"praefect-0": {"storage-0", "storage-1", "storage-2"},
diff --git a/internal/praefect/datastore/storage_provider_test.go b/internal/praefect/datastore/storage_provider_test.go
index 1c87ca120..4a907c5c1 100644
--- a/internal/praefect/datastore/storage_provider_test.go
+++ b/internal/praefect/datastore/storage_provider_test.go
@@ -95,7 +95,7 @@ func TestCachingStorageProvider_GetSyncedNodes(t *testing.T) {
ctx := testhelper.Context(t)
- cache, err := NewCachingConsistentStoragesGetter(testhelper.NewLogger(t), rs, []string{"vs"})
+ cache, err := NewCachingConsistentStoragesGetter(testhelper.SharedLogger(t), rs, []string{"vs"})
require.NoError(t, err)
cache.Connected()
@@ -114,7 +114,7 @@ func TestCachingStorageProvider_GetSyncedNodes(t *testing.T) {
t.Run("cache is disabled after handling invalid payload", func(t *testing.T) {
db.TruncateAll(t)
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
logHook := test.NewLocal(logger)
ctx := testhelper.Context(t)
diff --git a/internal/praefect/get_object_pool_test.go b/internal/praefect/get_object_pool_test.go
index 6f420d9bf..3274780a2 100644
--- a/internal/praefect/get_object_pool_test.go
+++ b/internal/praefect/get_object_pool_test.go
@@ -73,7 +73,7 @@ func TestGetObjectPoolHandler(t *testing.T) {
srv := NewGRPCServer(&Dependencies{
Config: config.Config{Failover: config.Failover{ElectionStrategy: config.ElectionStrategyPerRepository}},
- Logger: logrus.NewEntry(testhelper.NewLogger(t)),
+ Logger: logrus.NewEntry(testhelper.SharedLogger(t)),
Director: func(ctx context.Context, fullMethodName string, peeker proxy.StreamPeeker) (*proxy.StreamParameters, error) {
return nil, errServedByGitaly
},
diff --git a/internal/praefect/info_service_test.go b/internal/praefect/info_service_test.go
index 1b2a1ead4..d07ede6aa 100644
--- a/internal/praefect/info_service_test.go
+++ b/internal/praefect/info_service_test.go
@@ -67,7 +67,7 @@ func TestInfoService_RepositoryReplicas(t *testing.T) {
ctx := testhelper.Context(t)
db := testdb.New(t)
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
// the only thing used from the config is the grpc_latency_buckets which is not relevant for the test
txManager := transactions.NewManager(config.Config{})
sidechannelRegistry := sidechannel.NewRegistry()
diff --git a/internal/praefect/nodes/health_manager_test.go b/internal/praefect/nodes/health_manager_test.go
index 80dbd13b9..82ce6158b 100644
--- a/internal/praefect/nodes/health_manager_test.go
+++ b/internal/praefect/nodes/health_manager_test.go
@@ -493,7 +493,7 @@ func TestHealthManager(t *testing.T) {
}
}
- hm = NewHealthManager(testhelper.NewLogger(t), db, hc.PraefectName, clients)
+ hm = NewHealthManager(testhelper.SharedLogger(t), db, hc.PraefectName, clients)
hm.handleError = func(err error) error { return err }
healthManagers[hc.PraefectName] = hm
}
@@ -563,7 +563,7 @@ func TestHealthManager_databaseTimeout(t *testing.T) {
defer blockingTx.Rollback(t)
newHealthManager := func(db glsql.Querier) *HealthManager {
- return NewHealthManager(testhelper.NewLogger(t), db, "praefect", HealthClients{
+ return NewHealthManager(testhelper.SharedLogger(t), db, "praefect", HealthClients{
"virtual-storage": {
"gitaly": mockHealthClient{
CheckFunc: func(context.Context, *grpc_health_v1.HealthCheckRequest, ...grpc.CallOption) (*grpc_health_v1.HealthCheckResponse, error) {
@@ -633,12 +633,12 @@ func TestHealthManager_orderedWrites(t *testing.T) {
returnErr := func(err error) error { return err }
- hm1 := NewHealthManager(testhelper.NewLogger(t), tx1, praefectName, nil)
+ hm1 := NewHealthManager(testhelper.SharedLogger(t), tx1, praefectName, nil)
hm1.handleError = returnErr
require.NoError(t, hm1.updateHealthChecks(ctx, []string{virtualStorage}, []string{"gitaly-1"}, []bool{true}))
tx2Err := make(chan error, 1)
- hm2 := NewHealthManager(testhelper.NewLogger(t), tx2, praefectName, nil)
+ hm2 := NewHealthManager(testhelper.SharedLogger(t), tx2, praefectName, nil)
hm2.handleError = returnErr
go func() {
tx2Err <- hm2.updateHealthChecks(ctx, []string{virtualStorage, virtualStorage}, []string{"gitaly-2", "gitaly-1"}, []bool{true, true})
diff --git a/internal/praefect/nodes/local_elector_test.go b/internal/praefect/nodes/local_elector_test.go
index af951827d..db3ebb80b 100644
--- a/internal/praefect/nodes/local_elector_test.go
+++ b/internal/praefect/nodes/local_elector_test.go
@@ -28,10 +28,10 @@ func setupElector(t *testing.T) (*localElector, []*nodeStatus, *grpc.ClientConn)
storageName := "default"
mockHistogramVec0, mockHistogramVec1 := promtest.NewMockHistogramVec(), promtest.NewMockHistogramVec()
- cs := newConnectionStatus(config.Node{Storage: storageName}, cc, testhelper.NewLogger(t), mockHistogramVec0, nil)
- secondary := newConnectionStatus(config.Node{Storage: storageName}, cc, testhelper.NewLogger(t), mockHistogramVec1, nil)
+ cs := newConnectionStatus(config.Node{Storage: storageName}, cc, testhelper.SharedLogger(t), mockHistogramVec0, nil)
+ secondary := newConnectionStatus(config.Node{Storage: storageName}, cc, testhelper.SharedLogger(t), mockHistogramVec1, nil)
ns := []*nodeStatus{cs, secondary}
- logger := testhelper.NewLogger(t).WithField("test", t.Name())
+ logger := testhelper.SharedLogger(t).WithField("test", t.Name())
strategy := newLocalElector(storageName, logger, ns)
strategy.bootstrap(time.Second)
diff --git a/internal/praefect/nodes/manager_test.go b/internal/praefect/nodes/manager_test.go
index 1cb7b90d6..d8905bf6f 100644
--- a/internal/praefect/nodes/manager_test.go
+++ b/internal/praefect/nodes/manager_test.go
@@ -72,7 +72,7 @@ func TestNodeStatus(t *testing.T) {
mockHistogramVec := promtest.NewMockHistogramVec()
storageName := "default"
- cs := newConnectionStatus(config.Node{Storage: storageName}, cc, testhelper.NewLogger(t), mockHistogramVec, nil)
+ cs := newConnectionStatus(config.Node{Storage: storageName}, cc, testhelper.SharedLogger(t), mockHistogramVec, nil)
ctx := testhelper.Context(t)
var expectedLabels [][]string
@@ -119,7 +119,7 @@ func TestManagerFailoverDisabledElectionStrategySQL(t *testing.T) {
Failover: config.Failover{Enabled: false, ElectionStrategy: config.ElectionStrategySQL},
VirtualStorages: []*config.VirtualStorage{virtualStorage},
}
- nm, err := NewManager(testhelper.NewLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nm, err := NewManager(testhelper.SharedLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
nm.Start(time.Millisecond, time.Millisecond)
@@ -166,7 +166,7 @@ func TestDialWithUnhealthyNode(t *testing.T) {
testhelper.NewHealthServerWithListener(t, primaryLn)
- mgr, err := NewManager(testhelper.NewLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ mgr, err := NewManager(testhelper.SharedLogger(t), conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
mgr.Start(1*time.Millisecond, 1*time.Millisecond)
@@ -213,10 +213,10 @@ func TestNodeManager(t *testing.T) {
}
mockHistogram := promtest.NewMockHistogramVec()
- nm, err := NewManager(testhelper.NewLogger(t), confWithFailover, nil, nil, mockHistogram, protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nm, err := NewManager(testhelper.SharedLogger(t), confWithFailover, nil, nil, mockHistogram, protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
- nmWithoutFailover, err := NewManager(testhelper.NewLogger(t), confWithoutFailover, nil, nil, mockHistogram, protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nmWithoutFailover, err := NewManager(testhelper.SharedLogger(t), confWithoutFailover, nil, nil, mockHistogram, protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
// monitoring period set to 1 hour as we execute health checks by hands in this test
@@ -330,7 +330,7 @@ func TestMgr_GetSyncedNode(t *testing.T) {
},
}
- nm, err := NewManager(testhelper.NewLogger(t), conf, nil, rs, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nm, err := NewManager(testhelper.SharedLogger(t), conf, nil, rs, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
for i := range healthSrvs {
@@ -477,7 +477,7 @@ func TestNodeStatus_IsHealthy(t *testing.T) {
node := config.Node{Storage: "gitaly-0", Address: address}
ctx := testhelper.Context(t)
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
latencyHistMock := &promtest.MockHistogramVec{}
t.Run("unchecked node is unhealthy", func(t *testing.T) {
diff --git a/internal/praefect/nodes/sql_elector_test.go b/internal/praefect/nodes/sql_elector_test.go
index bf948ea1c..332cdcfe3 100644
--- a/internal/praefect/nodes/sql_elector_test.go
+++ b/internal/praefect/nodes/sql_elector_test.go
@@ -32,7 +32,7 @@ func TestGetPrimaryAndSecondaries(t *testing.T) {
t.Parallel()
db := testdb.New(t)
- logger := testhelper.NewLogger(t).WithField("test", t.Name())
+ logger := testhelper.SharedLogger(t).WithField("test", t.Name())
praefectSocket := testhelper.GetTemporaryGitalySocketFileName(t)
socketName := "unix://" + praefectSocket
@@ -53,7 +53,7 @@ func TestGetPrimaryAndSecondaries(t *testing.T) {
storageName := "default"
mockHistogramVec0 := promtest.NewMockHistogramVec()
- cs0 := newConnectionStatus(config.Node{Storage: storageName + "-0"}, cc0, testhelper.NewLogger(t), mockHistogramVec0, nil)
+ cs0 := newConnectionStatus(config.Node{Storage: storageName + "-0"}, cc0, testhelper.SharedLogger(t), mockHistogramVec0, nil)
ns := []*nodeStatus{cs0}
elector := newSQLElector(shardName, conf, db.DB, logger, ns)
@@ -76,7 +76,7 @@ func TestSqlElector_slow_execution(t *testing.T) {
db := testdb.New(t)
praefectSocket := "unix://" + testhelper.GetTemporaryGitalySocketFileName(t)
- logger := testhelper.NewLogger(t).WithField("test", t.Name())
+ logger := testhelper.SharedLogger(t).WithField("test", t.Name())
gitalySocket := testhelper.GetTemporaryGitalySocketFileName(t)
testhelper.NewServerWithHealth(t, gitalySocket)
@@ -112,7 +112,7 @@ func TestBasicFailover(t *testing.T) {
t.Parallel()
db := testdb.New(t)
- logger := testhelper.NewLogger(t).WithField("test", t.Name())
+ logger := testhelper.SharedLogger(t).WithField("test", t.Name())
praefectSocket := testhelper.GetTemporaryGitalySocketFileName(t)
socketName := "unix://" + praefectSocket
@@ -227,7 +227,7 @@ func TestElectDemotedPrimary(t *testing.T) {
shardName,
config.Config{},
nil,
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
[]*nodeStatus{{node: node}},
)
ctx := testhelper.Context(t)
@@ -426,7 +426,7 @@ func TestConnectionMultiplexing(t *testing.T) {
errNonMuxed := status.Error(codes.Internal, "non-muxed connection")
errMuxed := status.Error(codes.Internal, "muxed connection")
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
lm := listenmux.New(insecure.NewCredentials())
lm.Register(backchannel.NewServerHandshaker(logger, backchannel.NewRegistry(), nil))
@@ -455,7 +455,7 @@ func TestConnectionMultiplexing(t *testing.T) {
db := testdb.New(t)
mgr, err := NewManager(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
config.Config{
Failover: config.Failover{
Enabled: true,
diff --git a/internal/praefect/reconciler/reconciler_benchmark_test.go b/internal/praefect/reconciler/reconciler_benchmark_test.go
index 5a8a8f088..9372a6474 100644
--- a/internal/praefect/reconciler/reconciler_benchmark_test.go
+++ b/internal/praefect/reconciler/reconciler_benchmark_test.go
@@ -60,7 +60,7 @@ CROSS JOIN (SELECT unnest('{gitaly-1, gitaly-2, gitaly-3}'::text[]) AS storage)
for n := 0; n < b.N; n++ {
db.Truncate(b, "replication_queue", "replication_queue_lock", "replication_queue_job_lock")
r := NewReconciler(
- testhelper.NewLogger(b),
+ testhelper.SharedLogger(b),
db,
praefect.StaticHealthChecker(storages),
storages,
diff --git a/internal/praefect/reconciler/reconciler_test.go b/internal/praefect/reconciler/reconciler_test.go
index 283a6aafb..a7debac53 100644
--- a/internal/praefect/reconciler/reconciler_test.go
+++ b/internal/praefect/reconciler/reconciler_test.go
@@ -1071,7 +1071,7 @@ func TestReconciler(t *testing.T) {
}
reconciler := NewReconciler(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
tx,
praefect.StaticHealthChecker(tc.healthyStorages),
configuredStorages,
@@ -1198,7 +1198,7 @@ func TestReconciler_renames(t *testing.T) {
configuredStorages := map[string][]string{"virtual-storage": {"storage-1", "storage-2"}}
reconciler := NewReconciler(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
db,
praefect.StaticHealthChecker(configuredStorages),
configuredStorages,
diff --git a/internal/praefect/remove_all_test.go b/internal/praefect/remove_all_test.go
index 54c18ba98..b614854f9 100644
--- a/internal/praefect/remove_all_test.go
+++ b/internal/praefect/remove_all_test.go
@@ -77,7 +77,7 @@ Issue: https://gitlab.com/gitlab-org/gitaly/-/issues/5269`)
srv := NewGRPCServer(&Dependencies{
Config: config.Config{Failover: config.Failover{ElectionStrategy: config.ElectionStrategyPerRepository}},
- Logger: logrus.NewEntry(testhelper.NewLogger(t)),
+ Logger: logrus.NewEntry(testhelper.SharedLogger(t)),
Director: func(ctx context.Context, fullMethodName string, peeker proxy.StreamPeeker) (*proxy.StreamParameters, error) {
return nil, errServedByGitaly
},
diff --git a/internal/praefect/remove_repository_test.go b/internal/praefect/remove_repository_test.go
index e5ee08087..a4beddbfb 100644
--- a/internal/praefect/remove_repository_test.go
+++ b/internal/praefect/remove_repository_test.go
@@ -107,7 +107,7 @@ func TestRemoveRepositoryHandler(t *testing.T) {
srv := NewGRPCServer(&Dependencies{
Config: config.Config{Failover: config.Failover{ElectionStrategy: electionStrategy}},
- Logger: logrus.NewEntry(testhelper.NewLogger(t)),
+ Logger: logrus.NewEntry(testhelper.SharedLogger(t)),
Director: func(ctx context.Context, fullMethodName string, peeker proxy.StreamPeeker) (*proxy.StreamParameters, error) {
return nil, errServedByGitaly
},
diff --git a/internal/praefect/replicator_pg_test.go b/internal/praefect/replicator_pg_test.go
index ae6a808c5..3098e8735 100644
--- a/internal/praefect/replicator_pg_test.go
+++ b/internal/praefect/replicator_pg_test.go
@@ -48,7 +48,7 @@ func TestReplicatorInvalidSourceRepository(t *testing.T) {
require.NoError(t, err)
require.True(t, exists)
- r := &defaultReplicator{rs: rs, log: testhelper.NewLogger(t)}
+ r := &defaultReplicator{rs: rs, log: testhelper.SharedLogger(t)}
require.NoError(t, r.Replicate(ctx, datastore.ReplicationEvent{
Job: datastore.ReplicationJob{
RepositoryID: 1,
@@ -99,7 +99,7 @@ func TestReplicatorDestroy(t *testing.T) {
require.Equal(t, tc.error, defaultReplicator{
rs: rs,
- log: testhelper.NewLogger(t),
+ log: testhelper.SharedLogger(t),
}.Destroy(
ctx,
datastore.ReplicationEvent{
diff --git a/internal/praefect/replicator_test.go b/internal/praefect/replicator_test.go
index 84c7bc0e7..716cc5227 100644
--- a/internal/praefect/replicator_test.go
+++ b/internal/praefect/replicator_test.go
@@ -94,7 +94,7 @@ func testReplMgrProcessBacklog(t *testing.T, ctx context.Context) {
})
require.NoError(t, err)
- entry := testhelper.NewLogger(t)
+ entry := testhelper.SharedLogger(t)
nodeMgr, err := nodes.NewManager(entry, conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
@@ -129,7 +129,7 @@ func testReplMgrProcessBacklog(t *testing.T, ctx context.Context) {
var mockReplicationLatencyHistogramVec promtest.MockHistogramVec
var mockReplicationDelayHistogramVec promtest.MockHistogramVec
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
loggerHook := test.NewLocal(logger)
queue := datastore.NewReplicationEventQueueInterceptor(datastore.NewPostgresReplicationEventQueue(testdb.New(t)))
@@ -235,7 +235,7 @@ func TestReplicatorDowngradeAttempt(t *testing.T) {
},
}
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
hook := test.NewLocal(logger)
r := &defaultReplicator{rs: rs, log: logger}
@@ -279,13 +279,13 @@ func TestConfirmReplication(t *testing.T) {
require.NoError(t, err)
t.Cleanup(func() { require.NoError(t, conn.Close()) })
- equal, err := confirmChecksums(ctx, testhelper.NewLogger(t), gitalypb.NewRepositoryServiceClient(conn), gitalypb.NewRepositoryServiceClient(conn), testRepoA, testRepoB)
+ equal, err := confirmChecksums(ctx, testhelper.SharedLogger(t), gitalypb.NewRepositoryServiceClient(conn), gitalypb.NewRepositoryServiceClient(conn), testRepoA, testRepoB)
require.NoError(t, err)
require.True(t, equal)
gittest.WriteCommit(t, cfg, testRepoAPath, gittest.WithBranch("master"))
- equal, err = confirmChecksums(ctx, testhelper.NewLogger(t), gitalypb.NewRepositoryServiceClient(conn), gitalypb.NewRepositoryServiceClient(conn), testRepoA, testRepoB)
+ equal, err = confirmChecksums(ctx, testhelper.SharedLogger(t), gitalypb.NewRepositoryServiceClient(conn), gitalypb.NewRepositoryServiceClient(conn), testRepoA, testRepoB)
require.NoError(t, err)
require.False(t, equal)
}
@@ -385,7 +385,7 @@ func testProcessBacklogFailedJobs(t *testing.T, ctx context.Context) {
require.NoError(t, err)
require.Equal(t, uint64(2), event2.ID)
- logEntry := testhelper.NewLogger(t)
+ logEntry := testhelper.SharedLogger(t)
nodeMgr, err := nodes.NewManager(logEntry, conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
@@ -545,7 +545,7 @@ func testProcessBacklogSuccess(t *testing.T, ctx context.Context) {
_, err = queueInterceptor.Enqueue(ctx, eventType3)
require.NoError(t, err)
- logEntry := testhelper.NewLogger(t)
+ logEntry := testhelper.SharedLogger(t)
nodeMgr, err := nodes.NewManager(logEntry, conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
@@ -626,7 +626,7 @@ func TestReplMgrProcessBacklog_OnlyHealthyNodes(t *testing.T) {
node3 := Node{Storage: conf.VirtualStorages[0].Nodes[2].Storage}
replMgr := NewReplMgr(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
conf.StorageNames(),
queueInterceptor,
nil,
@@ -703,7 +703,7 @@ func TestProcessBacklog_ReplicatesToReadOnlyPrimary(t *testing.T) {
require.NoError(t, rs.CreateRepository(ctx, repositoryID, virtualStorage, "ignored", "ignored", primaryStorage, []string{secondaryStorage}, nil, true, false))
replMgr := NewReplMgr(
- testhelper.NewLogger(t),
+ testhelper.SharedLogger(t),
conf.StorageNames(),
queue,
rs,
@@ -789,7 +789,7 @@ func TestSubtractUint64(t *testing.T) {
}
func TestReplMgr_ProcessStale(t *testing.T) {
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
hook := test.NewLocal(logger)
queue := datastore.NewReplicationEventQueueInterceptor(nil)
diff --git a/internal/praefect/repocleaner/repository_test.go b/internal/praefect/repocleaner/repository_test.go
index 18ff71f36..83c21ab17 100644
--- a/internal/praefect/repocleaner/repository_test.go
+++ b/internal/praefect/repocleaner/repository_test.go
@@ -267,7 +267,7 @@ func TestRunner_Run_noAvailableStorages(t *testing.T) {
require.NoError(t, repoStore.CreateRepository(ctx, int64(i), conf.VirtualStorages[0].Name, set.relativePath, set.relativePath, set.primary, nil, nil, false, false))
}
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
entry := logger.WithContext(ctx)
clientHandshaker := backchannel.NewClientHandshaker(entry, praefect.NewBackchannelServerFactory(entry, transaction.NewServer(nil), nil), backchannel.DefaultConfiguration())
nodeSet, err := praefect.DialNodes(ctx, conf.VirtualStorages, protoregistry.GitalyProtoPreregistered, nil, clientHandshaker, nil)
diff --git a/internal/praefect/repository_exists_test.go b/internal/praefect/repository_exists_test.go
index 63d8e8bf6..d340ad4fb 100644
--- a/internal/praefect/repository_exists_test.go
+++ b/internal/praefect/repository_exists_test.go
@@ -88,7 +88,7 @@ func TestRepositoryExistsHandler(t *testing.T) {
srv := NewGRPCServer(&Dependencies{
Config: config.Config{Failover: config.Failover{ElectionStrategy: electionStrategy}},
- Logger: logrus.NewEntry(testhelper.NewLogger(t)),
+ Logger: logrus.NewEntry(testhelper.SharedLogger(t)),
Director: func(ctx context.Context, fullMethodName string, peeker proxy.StreamPeeker) (*proxy.StreamParameters, error) {
return nil, errServedByGitaly
},
diff --git a/internal/praefect/server_factory_test.go b/internal/praefect/server_factory_test.go
index fbb1f080a..ff729eca9 100644
--- a/internal/praefect/server_factory_test.go
+++ b/internal/praefect/server_factory_test.go
@@ -74,7 +74,7 @@ func TestServerFactory(t *testing.T) {
repo.StorageName = conf.VirtualStorages[0].Name // storage must be re-written to virtual to be properly redirected by praefect
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
queue := datastore.NewPostgresReplicationEventQueue(testdb.New(t))
rs := datastore.MockRepositoryStore{}
diff --git a/internal/praefect/server_test.go b/internal/praefect/server_test.go
index 66c8fe123..76b3ca36c 100644
--- a/internal/praefect/server_test.go
+++ b/internal/praefect/server_test.go
@@ -57,7 +57,7 @@ import (
func TestNewBackchannelServerFactory(t *testing.T) {
mgr := transactions.NewManager(config.Config{})
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
registry := backchannel.NewRegistry()
lm := listenmux.New(insecure.NewCredentials())
@@ -531,11 +531,11 @@ func TestRemoveRepository(t *testing.T) {
verifyReposExistence(t, codes.OK)
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
queueInterceptor := datastore.NewReplicationEventQueueInterceptor(datastore.NewPostgresReplicationEventQueue(testdb.New(t)))
repoStore := defaultRepoStore(praefectCfg)
txMgr := defaultTxMgr(praefectCfg)
- nodeMgr, err := nodes.NewManager(testhelper.NewLogger(t), praefectCfg, nil,
+ nodeMgr, err := nodes.NewManager(testhelper.SharedLogger(t), praefectCfg, nil,
repoStore, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered,
nil, backchannel.NewClientHandshaker(
logger,
@@ -606,7 +606,7 @@ func TestRenameRepository(t *testing.T) {
rs := datastore.NewPostgresRepositoryStore(db, nil)
txManager := transactions.NewManager(praefectCfg)
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
clientHandshaker := backchannel.NewClientHandshaker(
logger,
NewBackchannelServerFactory(
@@ -814,7 +814,7 @@ func TestProxyWrites(t *testing.T) {
}
queue := datastore.NewPostgresReplicationEventQueue(testdb.New(t))
- entry := testhelper.NewLogger(t)
+ entry := testhelper.SharedLogger(t)
nodeMgr, err := nodes.NewManager(entry, conf, nil, nil, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(t, err)
@@ -954,7 +954,7 @@ func TestErrorThreshold(t *testing.T) {
ctx := testhelper.Context(t)
queue := datastore.NewPostgresReplicationEventQueue(testdb.New(t))
- entry := testhelper.NewLogger(t)
+ entry := testhelper.SharedLogger(t)
testCases := []struct {
desc string
diff --git a/internal/praefect/testserver.go b/internal/praefect/testserver.go
index 247f20ad9..3ab759937 100644
--- a/internal/praefect/testserver.go
+++ b/internal/praefect/testserver.go
@@ -92,7 +92,7 @@ func defaultTxMgr(conf config.Config) *transactions.Manager {
}
func defaultNodeMgr(tb testing.TB, conf config.Config, rs datastore.RepositoryStore) nodes.Manager {
- nodeMgr, err := nodes.NewManager(logrus.NewEntry(testhelper.NewLogger(tb)), conf, nil, rs, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
+ nodeMgr, err := nodes.NewManager(logrus.NewEntry(testhelper.SharedLogger(tb)), conf, nil, rs, promtest.NewMockHistogramVec(), protoregistry.GitalyProtoPreregistered, nil, nil, nil)
require.NoError(tb, err)
nodeMgr.Start(0, time.Hour)
tb.Cleanup(nodeMgr.Stop)
@@ -205,7 +205,7 @@ func RunPraefectServer(
opt.WithAnnotations = protoregistry.GitalyProtoPreregistered
}
if opt.WithLogger == nil {
- opt.WithLogger = logrus.NewEntry(testhelper.NewLogger(tb))
+ opt.WithLogger = logrus.NewEntry(testhelper.SharedLogger(tb))
}
if opt.WithNodeMgr == nil {
opt.WithNodeMgr = defaultNodeMgr(tb, conf, opt.WithRepoStore)
diff --git a/internal/praefect/verifier_test.go b/internal/praefect/verifier_test.go
index 658d1a105..b7319df48 100644
--- a/internal/praefect/verifier_test.go
+++ b/internal/praefect/verifier_test.go
@@ -502,7 +502,7 @@ func TestVerifier(t *testing.T) {
}
db := testdb.New(t)
- logger := testhelper.NewLogger(t)
+ logger := testhelper.SharedLogger(t)
sidechannelRegistry := sidechannel.NewRegistry()
txManager := transactions.NewManager(config.Config{})
nodeSet, err := DialNodes(
diff --git a/internal/streamcache/cache_test.go b/internal/streamcache/cache_test.go
index d5e937464..f3a1bd57b 100644
--- a/internal/streamcache/cache_test.go
+++ b/internal/streamcache/cache_test.go
@@ -27,7 +27,7 @@ func newCache(tb testing.TB, dir string) Cache {
Enabled: true,
Dir: dir,
MaxAge: duration.Duration(time.Hour),
- }, testhelper.NewLogger(tb))
+ }, testhelper.SharedLogger(tb))
tb.Cleanup(cache.Stop)
return cache
@@ -248,7 +248,7 @@ func TestCache_diskCleanup(t *testing.T) {
return cleanSleepTimerCh
}
- c := newCacheWithSleep(tmp, 0, filestoreClean, cleanSleep, testhelper.NewLogger(t))
+ c := newCacheWithSleep(tmp, 0, filestoreClean, cleanSleep, testhelper.SharedLogger(t))
defer c.Stop()
var removalLock sync.Mutex
diff --git a/internal/streamcache/filestore_test.go b/internal/streamcache/filestore_test.go
index f588cbea6..40c8adca4 100644
--- a/internal/streamcache/filestore_test.go
+++ b/internal/streamcache/filestore_test.go
@@ -16,7 +16,7 @@ import (
func TestFilestoreCreate(t *testing.T) {
tmp := testhelper.TempDir(t)
- fs := newFilestore(tmp, 0, time.After, testhelper.NewLogger(t))
+ fs := newFilestore(tmp, 0, time.After, testhelper.SharedLogger(t))
defer fs.Stop()
f, err := fs.Create()
@@ -39,7 +39,7 @@ func TestFilestoreCreate(t *testing.T) {
func TestFilestoreCreate_concurrency(t *testing.T) {
tmp := testhelper.TempDir(t)
- fs := newFilestore(tmp, time.Hour, time.After, testhelper.NewLogger(t))
+ fs := newFilestore(tmp, time.Hour, time.After, testhelper.SharedLogger(t))
defer fs.Stop()
const N = 100
@@ -81,7 +81,7 @@ func TestFilestoreCreate_uniqueness(t *testing.T) {
filenames := make(map[string]struct{})
for j := 0; j < M; j++ {
- fs := newFilestore(tmp, time.Hour, time.After, testhelper.NewLogger(t))
+ fs := newFilestore(tmp, time.Hour, time.After, testhelper.SharedLogger(t))
defer fs.Stop()
for i := 0; i < N; i++ {
@@ -101,7 +101,7 @@ func TestFilestoreCreate_uniqueness(t *testing.T) {
func TestFilestoreCleanwalk(t *testing.T) {
tmp := testhelper.TempDir(t)
- fs := newFilestore(tmp, time.Hour, time.After, testhelper.NewLogger(t))
+ fs := newFilestore(tmp, time.Hour, time.After, testhelper.SharedLogger(t))
defer fs.Stop()
dir1 := filepath.Join(tmp, "dir1")
diff --git a/internal/tempdir/clean_test.go b/internal/tempdir/clean_test.go
index 2016c2ba9..a7e14ab4e 100644
--- a/internal/tempdir/clean_test.go
+++ b/internal/tempdir/clean_test.go
@@ -47,7 +47,7 @@ func TestCleanSuccess(t *testing.T) {
assertEntries(t, locator, cfg.Storages[0], "a", "c", "e", "f")
- require.NoError(t, clean(testhelper.NewLogger(t), locator, cfg.Storages[0]), "walk first pass")
+ require.NoError(t, clean(testhelper.SharedLogger(t), locator, cfg.Storages[0]), "walk first pass")
assertEntries(t, locator, cfg.Storages[0], "c", "e")
}
@@ -75,14 +75,14 @@ func TestCleanNoTmpExists(t *testing.T) {
cfg := testcfg.Build(t)
locator := config.NewLocator(cfg)
- require.NoError(t, clean(testhelper.NewLogger(t), locator, cfg.Storages[0]))
+ require.NoError(t, clean(testhelper.SharedLogger(t), locator, cfg.Storages[0]))
}
func TestCleanNoStorageExists(t *testing.T) {
cfg := testcfg.Build(t, testcfg.WithStorages("first"))
locator := config.NewLocator(cfg)
- err := clean(testhelper.NewLogger(t), locator, config.Storage{Name: "does-not-exist", Path: "/something"})
+ err := clean(testhelper.SharedLogger(t), locator, config.Storage{Name: "does-not-exist", Path: "/something"})
require.EqualError(t, err, "temporary dir: tmp dir: no such storage: \"does-not-exist\"")
}
@@ -104,7 +104,7 @@ func TestCleanerSafety(t *testing.T) {
}()
// We need to set up a mock locator which returns an invalid temporary directory path.
- require.NoError(t, clean(testhelper.NewLogger(t), mockLocator{}, config.Storage{}))
+ require.NoError(t, clean(testhelper.SharedLogger(t), mockLocator{}, config.Storage{}))
t.Fatal("expected panic")
}