From 6beaf0b5d4d6e6fe54e8076019ac2303e6f1ad05 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 31 Aug 2017 16:48:22 +0800 Subject: [PATCH] test: Don't dump core when using EXPECT_DEATH Signed-off-by: Kefu Chai --- src/test/common/Throttle.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/test/common/Throttle.cc b/src/test/common/Throttle.cc index 1e80dc1f35b8d..49d57dd961288 100644 --- a/src/test/common/Throttle.cc +++ b/src/test/common/Throttle.cc @@ -21,6 +21,13 @@ #include #include + +#include +#include +#include +#include +#include + #include "gtest/gtest.h" #include "common/backport14.h" #include "common/Mutex.h" @@ -28,13 +35,7 @@ #include "common/Throttle.h" #include "common/ceph_argparse.h" #include "common/backport14.h" - -#include -#include -#include -#include -#include -#include +#include "include/coredumpctl.h" class ThrottleTest : public ::testing::Test { protected: @@ -214,6 +215,7 @@ TEST_F(ThrottleTest, wait) { } TEST_F(ThrottleTest, destructor) { + PrCtl unset_dumpable; EXPECT_DEATH({ int64_t throttle_max = 10; auto throttle = ceph::make_unique(g_ceph_context, "throttle", @@ -348,6 +350,7 @@ std::pair > test_backoff( } TEST(BackoffThrottle, destruct) { + PrCtl unset_dumpable; EXPECT_DEATH({ auto throttle = ceph::make_unique( g_ceph_context, "destructor test", 10); @@ -421,6 +424,7 @@ TEST(BackoffThrottle, oversaturated) } TEST(OrderedThrottle, destruct) { + PrCtl unset_dumpable; EXPECT_DEATH({ auto throttle = ceph::make_unique(1, false); throttle->start_op(nullptr); -- 2.47.3