diff --git a/be/src/util/promise-test.cc b/be/src/util/promise-test.cc index 22baf4394..5061066d0 100644 --- a/be/src/util/promise-test.cc +++ b/be/src/util/promise-test.cc @@ -16,12 +16,30 @@ #include #include +#include using namespace boost; using namespace std; namespace impala { +struct ScopedLimitResetter { + public: + ScopedLimitResetter() { + getrlimit(RLIMIT_CORE, &limit_before_); + rlimit limit; + limit.rlim_cur = limit.rlim_max = 0; + setrlimit(RLIMIT_CORE, &limit); + } + + ~ScopedLimitResetter() { + setrlimit(RLIMIT_CORE, &limit_before_); + } + + private: + rlimit limit_before_; +}; + void RunThread(Promise* promise) { promise->Set(100); } @@ -34,6 +52,9 @@ TEST(PromiseTest, BasicTest) { } TEST(PromiseDeathTest, RepeatedSetTest) { + // This test intentionally causes a crash. Don't generate core files for it. + ScopedLimitResetter resetter; + // Hint to gtest that only one thread is being used here. Multiple threads are unsafe // for 'death' tests, see // https://code.google.com/p/googletest/wiki/AdvancedGuide#Death_Tests for more detail