]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/test_workqueue.cc
1 #include "gtest/gtest.h"
3 #include "common/WorkQueue.h"
4 #include "common/ceph_argparse.h"
6 TEST(WorkQueue
, StartStop
)
8 ThreadPool
tp(g_ceph_context
, "foo", "tp_foo", 10, "");
19 TEST(WorkQueue
, Resize
)
21 ThreadPool
tp(g_ceph_context
, "bar", "tp_bar", 2, "osd_peering_wq_threads");
26 ASSERT_EQ(2, tp
.get_num_threads());
28 g_conf
->set_val("osd peering wq threads", "5");
29 g_conf
->apply_changes(&cout
);
31 ASSERT_EQ(5, tp
.get_num_threads());
33 g_conf
->set_val("osd peering wq threads", "3");
34 g_conf
->apply_changes(&cout
);
36 ASSERT_EQ(3, tp
.get_num_threads());
38 g_conf
->set_val("osd peering wq threads", "0");
39 g_conf
->apply_changes(&cout
);
41 ASSERT_EQ(0, tp
.get_num_threads());
43 g_conf
->set_val("osd peering wq threads", "15");
44 g_conf
->apply_changes(&cout
);
46 ASSERT_EQ(15, tp
.get_num_threads());
48 g_conf
->set_val("osd peering wq threads", "-1");
49 g_conf
->apply_changes(&cout
);
51 ASSERT_EQ(15, tp
.get_num_threads());