1
0
mirror of https://github.com/redis/go-redis.git synced 2025-09-08 19:52:07 +03:00

disable logger for cleaner test output

This commit is contained in:
Nedyalko Dyakov
2025-08-29 22:00:24 +03:00
parent 919cc6a83f
commit 208ca701b8
3 changed files with 6 additions and 14 deletions

View File

@@ -346,3 +346,7 @@ func TestEventDrivenHandoffIntegration(t *testing.T) {
}
})
}
func init() {
SetLogger(&VoidLogger{})
}

View File

@@ -11,8 +11,6 @@ import (
. "github.com/bsm/ginkgo/v2"
. "github.com/bsm/gomega"
"github.com/redis/go-redis/v9"
"github.com/redis/go-redis/v9/internal"
"github.com/redis/go-redis/v9/internal/pool"
)
@@ -440,6 +438,5 @@ var _ = Describe("race", func() {
})
func init() {
filterLogger := internal.NewFilterLogger([]string{"test panic", "was not able to get a healthy connection after"})
redis.SetLogger(filterLogger)
redis.SetLogger(&redis.VoidLogger{})
}

View File

@@ -13,7 +13,6 @@ import (
. "github.com/bsm/ginkgo/v2"
. "github.com/bsm/gomega"
"github.com/redis/go-redis/v9"
"github.com/redis/go-redis/v9/internal"
)
const (
@@ -103,15 +102,7 @@ var _ = BeforeSuite(func() {
fmt.Printf("RCEDocker: %v\n", RCEDocker)
fmt.Printf("REDIS_VERSION: %.1f\n", RedisVersion)
fmt.Printf("CLIENT_LIBS_TEST_IMAGE: %v\n", os.Getenv("CLIENT_LIBS_TEST_IMAGE"))
filterLogger := internal.NewFilterLogger([]string{
"ERR unknown subcommand 'maint_notifications'",
"test panic",
"sentinel:",
"hitless:",
"pubsub:",
})
redis.SetLogger(filterLogger)
redis.SetLogger(&redis.VoidLogger{})
if RedisVersion < 7.0 || RedisVersion > 9 {
panic("incorrect or not supported redis version")