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 13:08:46 +0300
committerSami Hiltunen <shiltunen@gitlab.com>2023-08-31 09:28:29 +0300
commitefe1a5d80ba3e4c80522fa731b575fa84ca908e4 (patch)
tree53576f4b183c03ec958736caeeea8043e67c1fc8 /internal/streamcache
parent644d8262c09ef5436c4b3915f7da98be3c048caa (diff)
Replace use of NewDiscardingLogEntry with the recording logger
Gitaly now has a helper for recording log output and outputting it only in tests. Replace the usage of the discarding logger with the recording logger. These changes are search and replace so these call sites didn't even need a log entry to begin with but rather use a FieldLogger. NewDiscardingLogEntry is removed as it is no longer used.
Diffstat (limited to 'internal/streamcache')
-rw-r--r--internal/streamcache/cache_test.go4
-rw-r--r--internal/streamcache/filestore_test.go8
2 files changed, 6 insertions, 6 deletions
diff --git a/internal/streamcache/cache_test.go b/internal/streamcache/cache_test.go
index 6868e0bd1..d5e937464 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.NewDiscardingLogEntry(tb))
+ }, testhelper.NewLogger(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.NewDiscardingLogEntry(t))
+ c := newCacheWithSleep(tmp, 0, filestoreClean, cleanSleep, testhelper.NewLogger(t))
defer c.Stop()
var removalLock sync.Mutex
diff --git a/internal/streamcache/filestore_test.go b/internal/streamcache/filestore_test.go
index bc8466dd2..f588cbea6 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.NewDiscardingLogEntry(t))
+ fs := newFilestore(tmp, 0, time.After, testhelper.NewLogger(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.NewDiscardingLogEntry(t))
+ fs := newFilestore(tmp, time.Hour, time.After, testhelper.NewLogger(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.NewDiscardingLogEntry(t))
+ fs := newFilestore(tmp, time.Hour, time.After, testhelper.NewLogger(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.NewDiscardingLogEntry(t))
+ fs := newFilestore(tmp, time.Hour, time.After, testhelper.NewLogger(t))
defer fs.Stop()
dir1 := filepath.Join(tmp, "dir1")