diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-02-10 11:15:16 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-02-10 12:53:46 +0300 |
commit | bd9a4398974991d3caaaa937ad89b14e658a0104 (patch) | |
tree | 7d1ee1f96ebaf4e8fc6e8bfa6e95663390f2f92a /internal/praefect/grpc-proxy | |
parent | e01291b70c0305b3f30d1b0e391d505a7a698545 (diff) |
grpc-proxy: Do not print error messages to stderr
The grpc-proxy proxy handler tests set up a separate logger for GRPC log
messages, but we're already setting one up as part of the testhelper
configuration. This leads to a spew of log messages when those tests get
executed.
Fix this by just dropping the separate logger in favor of the testhelper
one. While that one is configured to only print messages with the
"panic" log level by default, this is rather considered a feature and
not a bug.
Diffstat (limited to 'internal/praefect/grpc-proxy')
-rw-r--r-- | internal/praefect/grpc-proxy/proxy/handler_test.go | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/internal/praefect/grpc-proxy/proxy/handler_test.go b/internal/praefect/grpc-proxy/proxy/handler_test.go index 9bcfdd673..20e4a15ab 100644 --- a/internal/praefect/grpc-proxy/proxy/handler_test.go +++ b/internal/praefect/grpc-proxy/proxy/handler_test.go @@ -8,7 +8,6 @@ import ( "errors" "fmt" "io" - "log" "net" "net/http" "net/http/httptest" @@ -34,7 +33,6 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/testhelper" "google.golang.org/grpc" "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -50,17 +48,6 @@ const ( countListResponses = 20 ) -type testLogger struct { - *log.Logger -} - -func (l *testLogger) Write(p []byte) (int, error) { - if err := l.Output(1, string(p)); err != nil { - return 0, err - } - return -1, nil -} - func TestMain(m *testing.M) { os.Exit(testMain(m)) } @@ -70,10 +57,6 @@ func testMain(m *testing.M) int { cleanup := testhelper.Configure() defer cleanup() - logger := &testLogger{ - log.New(os.Stderr, "grpc: ", log.LstdFlags), - } - grpclog.SetLoggerV2(grpclog.NewLoggerV2(logger, nil, nil)) return m.Run() } |