]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests: skip test 002 on legacy, containerized test runs
authorTom Hromatka <tom.hromatka@oracle.com>
Mon, 3 Jul 2023 15:58:13 +0000 (09:58 -0600)
committerTom Hromatka <tom.hromatka@oracle.com>
Wed, 5 Jul 2023 15:01:23 +0000 (09:01 -0600)
Skip test 002-cgdelete-recursive_delete.py on legacy (cgroup v1),
containerized test runs.  It occasionally fails in Github Actions, and
I think the failure is simply because the machine is underpowered.  In
these cases, the failure is usually reported as:
002-cgdelete-recursive_delete.py - Failed to get the pid of the child process:

Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
Reviewed-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
tests/ftests/002-cgdelete-recursive_delete.py

index b51abcdcc11f9ad2b9468ce248fb9485a0e0e414..d999ca6b9feec6e057f77a41fae6db24ed8da7a4 100755 (executable)
@@ -8,6 +8,7 @@
 #
 
 from cgroup import Cgroup, CgroupVersion
+from libcgroup import Mode
 import consts
 import ftests
 import sys
@@ -20,8 +21,17 @@ GRANDCHILD = 'grandchildcg'
 
 
 def prereqs(config):
-    # This test should run on both cgroup v1 and v2
-    pass
+    result = consts.TEST_PASSED
+    cause = None
+
+    # This test has shown inconsistent failures on underpowered legacy
+    # machines when run within a container.  Skip that configuration
+    if Cgroup.get_cgroup_mode(config) == Mode.CGROUP_MODE_LEGACY and \
+       config.args.container:
+        result = consts.TEST_SKIPPED
+        cause = 'Skip this test in containerized legacy hierarchies'
+
+    return result, cause
 
 
 def setup(config):
@@ -53,7 +63,10 @@ def teardown(config):
 
 
 def main(config):
-    prereqs(config)
+    [result, cause] = prereqs(config)
+    if result != consts.TEST_PASSED:
+        return [result, cause]
+
     setup(config)
     [result, cause] = test(config)
     teardown(config)