You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "haosdent (JIRA)" <ji...@apache.org> on 2016/10/29 11:46:58 UTC

[jira] [Commented] (MESOS-6422) cgroups_tests not correctly tearing down testing hierarchies

    [ https://issues.apache.org/jira/browse/MESOS-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15617997#comment-15617997 ] 

haosdent commented on MESOS-6422:
---------------------------------

We should update {{CgroupsTest}} to follow what we do in https://github.com/apache/mesos/blob/1.0.0/src/tests/mesos.cpp#L826-L861

{code}
    // Clean up any testing hierarchies.
    Try<std::set<string>> hierarchies = cgroups::hierarchies();
    ASSERT_SOME(hierarchies);
    foreach (const string& hierarchy, hierarchies.get()) {
      if (strings::startsWith(hierarchy, TEST_CGROUPS_HIERARCHY)) {
        AWAIT_READY(cgroups::cleanup(hierarchy));
      }
    }
{code}


> cgroups_tests not correctly tearing down testing hierarchies
> ------------------------------------------------------------
>
>                 Key: MESOS-6422
>                 URL: https://issues.apache.org/jira/browse/MESOS-6422
>             Project: Mesos
>          Issue Type: Bug
>          Components: containerization
>            Reporter: Yan Xu
>            Assignee: Yan Xu
>
> We currently do the following in [CgroupsTest::TearDownTestCase()|https://github.com/apache/mesos/blob/5e850a362edbf494921fedff4037cf4b53088c10/src/tests/containerizer/cgroups_tests.cpp#L83]
> {code:title=}
> static void TearDownTestCase()
> {
>   AWAIT_READY(cgroups::cleanup(TEST_CGROUPS_HIERARCHY));
> }
> {code}
> One of its derived test {{CgroupsNoHierarchyTest}} treats {{TEST_CGROUPS_HIERARCHY}} as a hierarchy so it's able to clean it up as a hierarchy.
> However another derived test {{CgroupsAnyHierarchyTest}} would create new hierarchies (if none is available) using {{TEST_CGROUPS_HIERARCHY}} as a parent directory (i.e., base hierarchy) and not as a hierarchy, so when it's time to clean up, it fails:
> {noformat:title=}
> [       OK ] CgroupsAnyHierarchyTest.ROOT_CGROUPS_Subsystems (1 ms)
> ../../src/tests/containerizer/cgroups_tests.cpp:88: Failure
> (cgroups::cleanup(TEST_CGROUPS_HIERARCHY)).failure(): Operation not permitted
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)