From 0156eb179ef4434c6a66f2512dd3403f9ed7bd85 Mon Sep 17 00:00:00 2001 From: Benjamin Elder Date: Wed, 10 Feb 2021 00:15:12 -0800 Subject: [PATCH] fix TestPidListerFailure on cgroupsv2 --- pkg/util/oom/oom_linux_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/util/oom/oom_linux_test.go b/pkg/util/oom/oom_linux_test.go index bfc3f480dcc..daf6f38f473 100644 --- a/pkg/util/oom/oom_linux_test.go +++ b/pkg/util/oom/oom_linux_test.go @@ -19,6 +19,8 @@ limitations under the License. package oom import ( + "os" + "github.com/opencontainers/runc/libcontainer/cgroups" "testing" @@ -100,5 +102,5 @@ func TestOOMScoreAdjContainer(t *testing.T) { func TestPidListerFailure(t *testing.T) { _, err := getPids("/does/not/exist") - assert.True(t, cgroups.IsNotFound(err), "expected getPids to return not exists error. Got %v", err) + assert.True(t, cgroups.IsNotFound(err) || os.IsNotExist(err), "expected getPids to return not exists error. Got %v", err) }