Repository: mesos Updated Branches: refs/heads/master f6f5d85a8 -> ad4959b52
Ensured that cgroups isolation is not used if multiple slaves are launched. Review: https://reviews.apache.org/r/37856 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/ad4959b5 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/ad4959b5 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/ad4959b5 Branch: refs/heads/master Commit: ad4959b521b50ecffaef5d9c473cd0ad67673a11 Parents: 5a05a9b Author: Jie Yu <[email protected]> Authored: Thu Aug 27 13:56:24 2015 -0700 Committer: Jie Yu <[email protected]> Committed: Thu Aug 27 17:02:40 2015 -0700 ---------------------------------------------------------------------- src/tests/environment.cpp | 9 --------- src/tests/event_call_framework_test.sh | 3 +++ src/tests/java_framework_test.sh | 3 +++ src/tests/no_executor_framework_test.sh | 3 +++ src/tests/persistent_volume_framework_test.sh | 3 +++ src/tests/python_framework_test.sh | 3 +++ src/tests/slave_recovery_tests.cpp | 8 ++++++++ src/tests/test_framework_test.sh | 3 +++ 8 files changed, 26 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/ad4959b5/src/tests/environment.cpp ---------------------------------------------------------------------- diff --git a/src/tests/environment.cpp b/src/tests/environment.cpp index 5253470..d9dc266 100644 --- a/src/tests/environment.cpp +++ b/src/tests/environment.cpp @@ -295,15 +295,6 @@ public: bool disable(const ::testing::TestInfo* test) const { -#ifdef WITH_NETWORK_ISOLATOR - // PortMappingIsolatorProcess doesn't suport test - // 'SlaveRecoveryTest.MultipleSlaves'. - if (matches(test, "SlaveRecoveryTest") && - matches(test, "MultipleSlaves")) { - return true; - } -#endif - if (matches(test, "PortMappingIsolatorTest") || matches(test, "PortMappingMesosTest")) { #ifdef WITH_NETWORK_ISOLATOR http://git-wip-us.apache.org/repos/asf/mesos/blob/ad4959b5/src/tests/event_call_framework_test.sh ---------------------------------------------------------------------- diff --git a/src/tests/event_call_framework_test.sh b/src/tests/event_call_framework_test.sh index 8eb3041..85394b5 100755 --- a/src/tests/event_call_framework_test.sh +++ b/src/tests/event_call_framework_test.sh @@ -27,6 +27,9 @@ export MESOS_NUM_SLAVES=3 # Set resources for the slave. export MESOS_RESOURCES="cpus:2;mem:10240" +# Set isolation for the slave. +export MESOS_ISOLATION="filesystem/posix,posix/cpu,posix/mem" + # Disable authentication as the scheduler library does not support it. export MESOS_AUTHENTICATE=false http://git-wip-us.apache.org/repos/asf/mesos/blob/ad4959b5/src/tests/java_framework_test.sh ---------------------------------------------------------------------- diff --git a/src/tests/java_framework_test.sh b/src/tests/java_framework_test.sh index 955fd8e..bab4336 100755 --- a/src/tests/java_framework_test.sh +++ b/src/tests/java_framework_test.sh @@ -27,5 +27,8 @@ export MESOS_NUM_SLAVES=3 # Set resources for the slave. export MESOS_RESOURCES="cpus:2;mem:10240" +# Set isolation for the slave. +export MESOS_ISOLATION="filesystem/posix,posix/cpu,posix/mem" + # Check that the Java test framework executes without crashing (returns 0). exec $MESOS_BUILD_DIR/src/examples/java/test-framework local http://git-wip-us.apache.org/repos/asf/mesos/blob/ad4959b5/src/tests/no_executor_framework_test.sh ---------------------------------------------------------------------- diff --git a/src/tests/no_executor_framework_test.sh b/src/tests/no_executor_framework_test.sh index b5bb111..11d34c8 100755 --- a/src/tests/no_executor_framework_test.sh +++ b/src/tests/no_executor_framework_test.sh @@ -27,5 +27,8 @@ export MESOS_NUM_SLAVES=3 # Set resources for the slave. export MESOS_RESOURCES="cpus:2;mem:10240" +# Set isolation for the slave. +export MESOS_ISOLATION="filesystem/posix,posix/cpu,posix/mem" + # Check that the C++ test framework executes without crashing (returns 0). exec ${MESOS_BUILD_DIR}/src/no-executor-framework --master=local --num_tasks=5 http://git-wip-us.apache.org/repos/asf/mesos/blob/ad4959b5/src/tests/persistent_volume_framework_test.sh ---------------------------------------------------------------------- diff --git a/src/tests/persistent_volume_framework_test.sh b/src/tests/persistent_volume_framework_test.sh index c96fb70..33bf9c7 100755 --- a/src/tests/persistent_volume_framework_test.sh +++ b/src/tests/persistent_volume_framework_test.sh @@ -24,5 +24,8 @@ export MESOS_WORK_DIR=${MESOS_WORK_DIR} # Set local Mesos runner to use 3 slaves export MESOS_NUM_SLAVES=3 +# Set isolation for the slave. +export MESOS_ISOLATION="filesystem/posix,posix/cpu,posix/mem" + # Check that the framework executes without crashing (returns 0). exec ${MESOS_BUILD_DIR}/src/persistent-volume-framework --master=local http://git-wip-us.apache.org/repos/asf/mesos/blob/ad4959b5/src/tests/python_framework_test.sh ---------------------------------------------------------------------- diff --git a/src/tests/python_framework_test.sh b/src/tests/python_framework_test.sh index 2a322da..88bce21 100755 --- a/src/tests/python_framework_test.sh +++ b/src/tests/python_framework_test.sh @@ -27,5 +27,8 @@ export MESOS_NUM_SLAVES=3 # Set resources for the slave. export MESOS_RESOURCES="cpus:2;mem:10240" +# Set isolation for the slave. +export MESOS_ISOLATION="filesystem/posix,posix/cpu,posix/mem" + # Check that the Python test framework executes without crashing (returns 0). exec $MESOS_BUILD_DIR/src/examples/python/test-framework local http://git-wip-us.apache.org/repos/asf/mesos/blob/ad4959b5/src/tests/slave_recovery_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/slave_recovery_tests.cpp b/src/tests/slave_recovery_tests.cpp index e1392a2..4d137e0 100644 --- a/src/tests/slave_recovery_tests.cpp +++ b/src/tests/slave_recovery_tests.cpp @@ -2931,6 +2931,10 @@ TYPED_TEST(SlaveRecoveryTest, MultipleSlaves) // Start the first slave. slave::Flags flags1 = this->CreateSlaveFlags(); + // NOTE: We cannot run multiple slaves simultaneously on a host if + // cgroups isolation is involved. + flags1.isolation = "filesystem/posix,posix/mem,posix/cpu"; + #ifdef __linux__ // Disable putting slave into cgroup(s) because this is a multi-slave test. flags1.slave_subsystems = None(); @@ -2968,6 +2972,10 @@ TYPED_TEST(SlaveRecoveryTest, MultipleSlaves) // Start the second slave. slave::Flags flags2 = this->CreateSlaveFlags(); + // NOTE: We cannot run multiple slaves simultaneously on a host if + // cgroups isolation is involved. + flags2.isolation = "filesystem/posix,posix/mem,posix/cpu"; + #ifdef __linux__ // Disable putting slave into cgroup(s) because this is a multi-slave test. flags2.slave_subsystems = None(); http://git-wip-us.apache.org/repos/asf/mesos/blob/ad4959b5/src/tests/test_framework_test.sh ---------------------------------------------------------------------- diff --git a/src/tests/test_framework_test.sh b/src/tests/test_framework_test.sh index 209e9d8..b13cdd8 100755 --- a/src/tests/test_framework_test.sh +++ b/src/tests/test_framework_test.sh @@ -27,5 +27,8 @@ export MESOS_NUM_SLAVES=3 # Set resources for the slave. export MESOS_RESOURCES="cpus:2;mem:10240" +# Set isolation for the slave. +export MESOS_ISOLATION="filesystem/posix,posix/cpu,posix/mem" + # Check that the C++ test framework executes without crashing (returns 0). exec ${MESOS_BUILD_DIR}/src/test-framework --master=local
