You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2014/05/20 00:12:13 UTC

git commit: Fixed the broken build on OSX caused by cgroups::enabled().

Repository: mesos
Updated Branches:
  refs/heads/master be8b90792 -> ce98036ed


Fixed the broken build on OSX caused by cgroups::enabled().

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


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

Branch: refs/heads/master
Commit: ce98036ed3a2136572525c8e9976f04f15f1f327
Parents: be8b907
Author: Jie Yu <yu...@gmail.com>
Authored: Mon May 19 15:10:49 2014 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Mon May 19 15:10:49 2014 -0700

----------------------------------------------------------------------
 src/tests/environment.cpp          | 13 ++++++++++---
 src/tests/slave_recovery_tests.cpp | 16 ++++++++--------
 2 files changed, 18 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/ce98036e/src/tests/environment.cpp
----------------------------------------------------------------------
diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp
index 3f4eaad..3e10508 100644
--- a/src/tests/environment.cpp
+++ b/src/tests/environment.cpp
@@ -81,8 +81,12 @@ static bool enable(const ::testing::TestInfo& test)
       return false;
     }
 
-    if (strings::contains(name, "CGROUPS_") && !cgroups::enabled()) {
+    if (strings::contains(name, "CGROUPS_")) {
+#ifdef __linux__
+      return cgroups::enabled();
+#else
       return false;
+#endif
     }
 
 #ifdef __linux__
@@ -128,9 +132,12 @@ static bool enable(const ::testing::TestInfo& test)
   // Now check the type parameter.
   if (test.type_param() != NULL) {
     const string& type = test.type_param();
-    if (strings::contains(type, "Cgroups") &&
-        (os::user() != "root" || !cgroups::enabled())) {
+    if (strings::contains(type, "Cgroups")) {
+#ifdef __linux__
+      return os::user() == "root" && cgroups::enabled();
+#else
       return false;
+#endif
     }
   }
 

http://git-wip-us.apache.org/repos/asf/mesos/blob/ce98036e/src/tests/slave_recovery_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp
index 11a1430..6de811e 100644
--- a/src/tests/slave_recovery_tests.cpp
+++ b/src/tests/slave_recovery_tests.cpp
@@ -2858,10 +2858,10 @@ TYPED_TEST(SlaveRecoveryTest, MultipleSlaves)
   // Start the first slave.
   slave::Flags flags1 = this->CreateSlaveFlags();
 
-  if (flags1.slave_subsystems.isSome()) {
-    // Disable putting slave into cgroup(s) because this is a multi-slave test.
-    flags1.slave_subsystems = None();
-  }
+#ifdef __linux__
+  // Disable putting slave into cgroup(s) because this is a multi-slave test.
+  flags1.slave_subsystems = None();
+#endif
 
   Try<TypeParam*> containerizer1 = TypeParam::create(flags1, true);
   ASSERT_SOME(containerizer1);
@@ -2895,10 +2895,10 @@ TYPED_TEST(SlaveRecoveryTest, MultipleSlaves)
   // Start the second slave.
   slave::Flags flags2 = this->CreateSlaveFlags();
 
-  if (flags2.slave_subsystems.isSome()) {
-    // Disable putting slave into cgroup(s) because this is a multi-slave test.
-    flags2.slave_subsystems = None();
-  }
+#ifdef __linux__
+  // Disable putting slave into cgroup(s) because this is a multi-slave test.
+  flags2.slave_subsystems = None();
+#endif
 
   Try<TypeParam*> containerizer2 = TypeParam::create(flags2, true);
   ASSERT_SOME(containerizer2);