From a4ff70e0eab76e0098a0bff0a6819564d1b302f6 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 11 Oct 2024 10:45:56 -0400 Subject: [PATCH] 22185: Fix global state leaked by test case. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- lib/crunchrun/cgroup_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/crunchrun/cgroup_test.go b/lib/crunchrun/cgroup_test.go index d2f9ff4163..22cda8506c 100644 --- a/lib/crunchrun/cgroup_test.go +++ b/lib/crunchrun/cgroup_test.go @@ -86,6 +86,12 @@ func (s *CgroupSuite) TestCgroupSupport(c *C) { } func (s *CgroupSuite) TestCgroup1Support(c *C) { + defer func() { + // Reset global state. Other tests need to re-check + // the real system config instead of using the results + // from our fake /proc/self/cgroup. + cgroupSupport = nil + }() tmpdir := c.MkDir() err := os.MkdirAll(tmpdir+"/proc/self", 0777) c.Assert(err, IsNil) -- 2.39.5