bmahler commented on code in PR #546:
URL: https://github.com/apache/mesos/pull/546#discussion_r1548548799
##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -82,6 +87,10 @@ class Cgroups2Test : public TemporaryDirectoryTest
{
TemporaryDirectoryTest::SetUp();
+ // Move ourselves into the root cgroup, in case we moved out of the
+ // root cgroup during a previous test and didn't move back.
+ ASSERT_SOME(cgroups2::assign(cgroups2::ROOT_CGROUP, ::getpid()));
Review Comment:
can we avoid assuming that we are running in the root cgroup? it doesn't
seem like something we need to assume, since the mesos code in general doesn't
assume this already, it'd be nice if the tests also don't assume this?
##########
src/tests/containerizer/cgroups2_tests.cpp:
##########
@@ -181,6 +194,55 @@ TEST_F(Cgroups2Test, ROOT_CGROUPS2_AssignProcesses)
}
+TEST_F(Cgroups2Test, ROOT_CGROUPS2_Threads)
+{
+ const size_t NUM_THREADS = 5;
+ std::thread* runningThreads[NUM_THREADS];
+
+ Latch* latch = new Latch();
+
+ for (size_t i = 0; i < NUM_THREADS; ++i) {
+ runningThreads[i] = new std::thread([=]() {
+ // Wait until the main thread tells us to exit.
+ latch->await();
+ });
+ }
Review Comment:
per offline discussion, looks like this is carried over from the v1 tests,
but this can leak during test failures
also, the test overall looks like it should take the same approach of
forking and moving into a test cgroup?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]