Repository: mesos
Updated Branches:
  refs/heads/master 4c4dcc5a9 -> 5e4c596ac


Fix failed test LimitedCpuIsolatorTest.ROOT_CGROUPS_Pids_and_Tids

This test is to isolate one single process with one thread in cgroup, and checks
the number of processes and threads in the cgroup before/after isolation. The
previous test case uses "sh -c "while true; do sleep 1; done;"" as the process,
however, it periodically forks a child process "sleep 1" in cgroup causing the
test failure (expected number of process/thread should be 1, but here is 2).
This patch is to issue a "cat" command, so there will be only one process in
cgroup.

Review: https://reviews.apache.org/r/38454


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/5e4c596a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/5e4c596a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/5e4c596a

Branch: refs/heads/master
Commit: 5e4c596aca07a7b80e75ddbbce56ac3074593239
Parents: 4c4dcc5
Author: Jian Qiu <[email protected]>
Authored: Wed Nov 4 18:05:33 2015 -0500
Committer: Kapil Arya <[email protected]>
Committed: Wed Nov 4 19:02:42 2015 -0500

----------------------------------------------------------------------
 src/tests/containerizer/isolator_tests.cpp | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/5e4c596a/src/tests/containerizer/isolator_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/isolator_tests.cpp 
b/src/tests/containerizer/isolator_tests.cpp
index 4e1e90b..a707212 100644
--- a/src/tests/containerizer/isolator_tests.cpp
+++ b/src/tests/containerizer/isolator_tests.cpp
@@ -689,14 +689,12 @@ TEST_F(LimitedCpuIsolatorTest, ROOT_CGROUPS_Pids_and_Tids)
   int pipes[2];
   ASSERT_NE(-1, ::pipe(pipes));
 
-  vector<string> argv(3);
-  argv[0] = "sh";
-  argv[1] = "-c";
-  argv[2] = "while true; do sleep 1; done;";
+  vector<string> argv(1);
+  argv[0] = "cat";
 
   Try<pid_t> pid = launcher.get()->fork(
       containerId,
-      "sh",
+      "cat",
       argv,
       Subprocess::FD(STDIN_FILENO),
       Subprocess::FD(STDOUT_FILENO),

Reply via email to