You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ti...@apache.org on 2018/11/24 01:22:33 UTC

[mesos] 02/02: Skipped an rlimit test if the environment is incompatible.

This is an automated email from the ASF dual-hosted git repository.

tillt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mesos.git

commit ee3cc43ae6d034645c6a8a627816d30fe3a16836
Author: Benjamin Bannier <be...@mesosphere.io>
AuthorDate: Sat Nov 24 02:18:45 2018 +0100

    Skipped an rlimit test if the environment is incompatible.
    
    Review: https://reviews.apache.org/r/69438/
---
 .../containerizer/posix_rlimits_isolator_tests.cpp      | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/tests/containerizer/posix_rlimits_isolator_tests.cpp b/src/tests/containerizer/posix_rlimits_isolator_tests.cpp
index 3af0044..938aa90 100644
--- a/src/tests/containerizer/posix_rlimits_isolator_tests.cpp
+++ b/src/tests/containerizer/posix_rlimits_isolator_tests.cpp
@@ -33,7 +33,10 @@
 
 #include <stout/hashmap.hpp>
 
+#include "posix/rlimits.hpp"
+
 #include "slave/flags.hpp"
+
 #include "tests/cluster.hpp"
 #include "tests/environment.hpp"
 #include "tests/mesos.hpp"
@@ -122,8 +125,22 @@ TEST_F(PosixRLimitsIsolatorTest, InvalidLimits)
 
 // This test confirms that setting no values for the soft and hard
 // limits implies an unlimited resource.
+//
+// NOTE: This test requires user to have set a unlimited hard core
+// file size limit.
 TEST_F(PosixRLimitsIsolatorTest, UnsetLimits)
 {
+  // TODO(bbannier): Instead of asserting here dynamically disable
+  // the test if we encounter an incompatible rlimit.
+  Try<RLimitInfo::RLimit> limit = rlimits::get(RLimitInfo::RLimit::RLMT_CORE);
+  ASSERT_SOME(limit);
+  ASSERT_FALSE(limit->has_hard())
+    << "-------------------------------------------------------------\n"
+    << "We cannot run this test because it appears you have a finite hard\n"
+    << "core file size rlimit set. Feel free to disable this test or set a\n"
+    << "higher limit with 'ulimit -H -c unlimited' for your user.\n"
+    << "-------------------------------------------------------------";
+
   Try<Owned<cluster::Master>> master = StartMaster();
   ASSERT_SOME(master);