From 932cff5dd41c09ddadb4ba2bce50639c46143cc0 Mon Sep 17 00:00:00 2001 From: Natasha Sarkar Date: Wed, 16 Apr 2025 18:38:52 +0000 Subject: [PATCH] add more error details to the failing cgroup check --- test/e2e/framework/pod/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/e2e/framework/pod/utils.go b/test/e2e/framework/pod/utils.go index 0a2984e61bb..8205b5dba08 100644 --- a/test/e2e/framework/pod/utils.go +++ b/test/e2e/framework/pod/utils.go @@ -301,12 +301,12 @@ func VerifyCgroupValue(f *framework.Framework, pod *v1.Pod, cName, cgPath string pod.Namespace, pod.Name, cName, expectedCgValues, cgPath) cgValue, _, err := ExecCommandInContainerWithFullOutput(f, pod.Name, cName, "/bin/sh", "-c", cmd) if err != nil { - return fmt.Errorf("failed to find one of the expected cgroup values %q in container cgroup %q: %w", expectedCgValues, cgPath, err) + return fmt.Errorf("failed to read cgroup value %q for container %q: %w", cgPath, cName, err) } cgValue = strings.Trim(cgValue, "\n") if err := framework.Gomega().Expect(cgValue).To(gomega.BeElementOf(expectedCgValues)); err != nil { - return fmt.Errorf("value of cgroup %q for container %q should match one of the expectations: %w", cgPath, cName, err) + return fmt.Errorf("value of cgroup %q for container %q was %q; expected one of %q", cgPath, cName, cgValue, expectedCgValues) } return nil