]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Don't dump core when using EXPECT_DEATH 17390/head
authorKefu Chai <kchai@redhat.com>
Thu, 31 Aug 2017 08:48:22 +0000 (16:48 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 31 Aug 2017 09:12:28 +0000 (17:12 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/test/common/Throttle.cc

index 1e80dc1f35b8d860df8a3bae9cb3d2732dc12ef9..49d57dd9612880d47dc992097119afe054d2373f 100644 (file)
 
 #include <stdio.h>
 #include <signal.h>
+
+#include <chrono>
+#include <list>
+#include <mutex>
+#include <random>
+#include <thread>
+
 #include "gtest/gtest.h"
 #include "common/backport14.h"
 #include "common/Mutex.h"
 #include "common/Throttle.h"
 #include "common/ceph_argparse.h"
 #include "common/backport14.h"
-
-#include <thread>
-#include <atomic>
-#include <chrono>
-#include <mutex>
-#include <list>
-#include <random>
+#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<Throttle>(g_ceph_context, "throttle",
@@ -348,6 +350,7 @@ std::pair<double, std::chrono::duration<double> > test_backoff(
 }
 
 TEST(BackoffThrottle, destruct) {
+  PrCtl unset_dumpable;
   EXPECT_DEATH({
       auto throttle = ceph::make_unique<BackoffThrottle>(
        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<OrderedThrottle>(1, false);
       throttle->start_op(nullptr);