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:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2022-12-14 11:59:43 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2022-12-19 12:02:21 +0300
commit96b3c4bf6b8de0f3475ea6798f5e6ec9ddf2678b (patch)
treeb5bf848f350e313a9e03f42b2eb51c4efbb7d810
parentd34f576112de436f79854197770acbcc8f69d61d (diff)
cgroups: Stop exercising whether the `command` package logs data
One of the cgroups tests that verifies whether metrics are exposed as expected also verifies that we get a log message. This log message is not generated by the cgroups package though, but it's generated by the command package. So it really is not the business of the cgroups tests to verify that we see this log message. Stop asserting the log message. This change also prepares us for a fix to a cyclic dependency between the command and cgroups package.
-rw-r--r--internal/cgroups/v1_linux_test.go14
1 files changed, 0 insertions, 14 deletions
diff --git a/internal/cgroups/v1_linux_test.go b/internal/cgroups/v1_linux_test.go
index ad19884e7..13d00177c 100644
--- a/internal/cgroups/v1_linux_test.go
+++ b/internal/cgroups/v1_linux_test.go
@@ -12,10 +12,7 @@ import (
"strings"
"testing"
- "github.com/grpc-ecosystem/go-grpc-middleware/logging/logrus/ctxlogrus"
"github.com/prometheus/client_golang/prometheus/testutil"
- "github.com/sirupsen/logrus"
- "github.com/sirupsen/logrus/hooks/test"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitaly/v15/internal/command"
@@ -180,9 +177,6 @@ func TestMetrics(t *testing.T) {
require.NoError(t, v1Manager1.Setup())
ctx := testhelper.Context(t)
- logger, hook := test.NewNullLogger()
- logger.SetLevel(logrus.DebugLevel)
- ctx = ctxlogrus.ToContext(ctx, logrus.NewEntry(logger))
cmd, err := command.New(ctx, []string{"ls", "-hal", "."}, command.WithCgroup(v1Manager1, repo))
require.NoError(t, err)
@@ -226,14 +220,6 @@ gitaly_cgroup_procs_total{path="%s",subsystem="memory"} 1
v1Manager1,
bytes.NewBufferString("")))
}
-
- logEntry := hook.LastEntry()
- assert.Contains(
- t,
- logEntry.Data["command.cgroup_path"],
- repoCgroupPath,
- "log field includes a cgroup path that is a subdirectory of the current process' cgroup path",
- )
})
}
}