def kill_all_tasks_recursively(self, kill_process_fn):
        def kill_all_tasks_in_cgroup_recursively(cgroup):
            files = [os.path.join(cgroup,f) for f in os.listdir(cgroup)]
            subdirs = filter(os.path.isdir, files)

            for subCgroup in subdirs:
                kill_all_tasks_in_cgroup_recursively(subCgroup)
                remove_cgroup(subCgroup)

            kill_all_tasks_in_cgroup(cgroup, kill_process_fn)

        for cgroup in self.paths:
            kill_all_tasks_in_cgroup_recursively(cgroup)
Test archiving of a super-entity instance record
dataset/ETHPy150Open sosy-lab/benchexec/benchexec/cgroups.py/Cgroup.kill_all_tasks_recursively--crossover with--dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3resource.py/ResourceDeleteTests.testArchiveSuperCascade