chore(test): Allow running tests with epoll proactor (#364)
This commit is contained in:
parent
d93eb8a5b5
commit
fbdfe5885a
|
@ -24,7 +24,7 @@ cxx_link(dragonfly_lib dfly_transaction dfly_facade redis_lib strings_lib html_l
|
|||
absl::random_random TRDP::jsoncons)
|
||||
|
||||
add_library(dfly_test_lib test_utils.cc)
|
||||
cxx_link(dfly_test_lib dragonfly_lib facade_test gtest_main_ext)
|
||||
cxx_link(dfly_test_lib dragonfly_lib epoll_fiber_lib facade_test gtest_main_ext)
|
||||
|
||||
cxx_test(dragonfly_test dfly_test_lib LABELS DFLY)
|
||||
cxx_test(generic_family_test dfly_test_lib LABELS DFLY)
|
||||
|
|
|
@ -17,10 +17,13 @@ extern "C" {
|
|||
#include "base/stl_util.h"
|
||||
#include "facade/dragonfly_connection.h"
|
||||
#include "util/uring/uring_pool.h"
|
||||
#include "util/epoll/epoll_pool.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
ABSL_DECLARE_FLAG(string, dbfilename);
|
||||
ABSL_FLAG(bool, force_epoll, false, "If true, uses epoll api instead iouring to run tests");
|
||||
|
||||
|
||||
namespace dfly {
|
||||
|
||||
|
@ -123,7 +126,11 @@ void BaseFamilyTest::SetUpTestSuite() {
|
|||
}
|
||||
|
||||
void BaseFamilyTest::SetUp() {
|
||||
pp_.reset(new uring::UringPool(16, num_threads_));
|
||||
if (absl::GetFlag(FLAGS_force_epoll)) {
|
||||
pp_.reset(new epoll::EpollPool(num_threads_));
|
||||
} else {
|
||||
pp_.reset(new uring::UringPool(16, num_threads_));
|
||||
}
|
||||
pp_->Run();
|
||||
service_.reset(new Service{pp_.get()});
|
||||
|
||||
|
|
Loading…
Reference in New Issue