You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2015/12/01 23:00:16 UTC

[2/2] mesos git commit: Checked if swap is enabled before running memory pressure related tests.

Checked if swap is enabled before running memory pressure related
tests.

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


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

Branch: refs/heads/master
Commit: c3dd3edb6f09de4333645cb87ba25c9d1c8969c3
Parents: 5a21baa
Author: Chi Zhang <ch...@gmail.com>
Authored: Tue Dec 1 13:56:49 2015 -0800
Committer: Vinod Kone <vi...@gmail.com>
Committed: Tue Dec 1 13:59:53 2015 -0800

----------------------------------------------------------------------
 src/tests/containerizer/cgroups_tests.cpp | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c3dd3edb/src/tests/containerizer/cgroups_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/containerizer/cgroups_tests.cpp b/src/tests/containerizer/cgroups_tests.cpp
index 919ff19..5e15d44 100644
--- a/src/tests/containerizer/cgroups_tests.cpp
+++ b/src/tests/containerizer/cgroups_tests.cpp
@@ -555,6 +555,17 @@ TEST_F(CgroupsAnyHierarchyWithCpuMemoryTest, ROOT_CGROUPS_Listen)
     << "this test.\n"
     << "-------------------------------------------------------------";
 
+  Try<os::Memory> memory = os::memory();
+  ASSERT_SOME(memory);
+
+  // TODO(vinod): Instead of asserting here dynamically disable
+  // the test if swap is enabled on the host.
+  ASSERT_EQ(memory.get().totalSwap, Bytes(0))
+    << "-------------------------------------------------------------\n"
+    << "We cannot run this test because it appears you have swap\n"
+    << "enabled, but feel free to disable this test.\n"
+    << "-------------------------------------------------------------";
+
   const Bytes limit =  Megabytes(64);
 
   ASSERT_SOME(cgroups::memory::limit_in_bytes(
@@ -1073,6 +1084,17 @@ protected:
 
 TEST_F(CgroupsAnyHierarchyMemoryPressureTest, ROOT_IncreaseRSS)
 {
+  Try<os::Memory> memory = os::memory();
+  ASSERT_SOME(memory);
+
+  // TODO(vinod): Instead of asserting here dynamically disable
+  // the test if swap is enabled on the host.
+  ASSERT_EQ(memory.get().totalSwap, Bytes(0))
+    << "-------------------------------------------------------------\n"
+    << "We cannot run this test because it appears you have swap\n"
+    << "enabled, but feel free to disable this test.\n"
+    << "-------------------------------------------------------------";
+
   MemoryTestHelper helper;
   ASSERT_SOME(helper.spawn());
   ASSERT_SOME(helper.pid());