From f6562f19a38a49ee07cdb46f6667e319b2d0487c Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 3 Apr 2023 15:20:47 -0700 Subject: [PATCH] [1.1] libct/cg/dev: skip flaky test of CentOS 7 There is some kind of a race in CentOS 7 which sometimes result in one of these tests failing like this: systemd_test.go:136: mkdir /sys/fs/cgroup/hugetlb/system.slice/system-runc_test_pods.slice: no such file or directory or systemd_test.go:187: open /sys/fs/cgroup/cpuset/system.slice/system-runc_test_pods.slice/cpuset.mems: no such file or directory As this is only happening on CentOS 7, let's skip this test on this platform. [This is a manual cherry-pick of main commit a7a836effa691edb6e.] Signed-off-by: Kir Kolyshkin --- libcontainer/cgroups/systemd/systemd_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libcontainer/cgroups/systemd/systemd_test.go b/libcontainer/cgroups/systemd/systemd_test.go index 7417bf28789..b2fb7d58ded 100644 --- a/libcontainer/cgroups/systemd/systemd_test.go +++ b/libcontainer/cgroups/systemd/systemd_test.go @@ -183,6 +183,11 @@ func testSkipDevices(t *testing.T, skipDevices bool, expected []string) { if os.Geteuid() != 0 { t.Skip("Test requires root.") } + // https://github.com/opencontainers/runc/issues/3743 + centosVer, _ := exec.Command("rpm", "-q", "--qf", "%{version}", "centos-release").CombinedOutput() + if string(centosVer) == "7" { + t.Skip("Flaky on CentOS 7") + } podConfig := &configs.Cgroup{ Parent: "system.slice",