diff options
author | Craig Tiller <ctiller@google.com> | 2015-02-11 15:25:03 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-02-11 15:25:03 -0800 |
commit | 7418d01de4b10b5870b8b78a4ce5198beae49445 (patch) | |
tree | 0ec5053138cf3d8834c4f9079b6e9b9c461714f0 /test | |
parent | 7596e7d12c6e86bd250f65708aedc982b7e6524e (diff) |
Make end2end_test use fewer threads
Helps finding interesting threads in gdb much easier
Diffstat (limited to 'test')
-rw-r--r-- | test/cpp/end2end/end2end_test.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 52deb0f32d..2aaecb4e11 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -38,6 +38,7 @@ #include "test/cpp/util/echo_duplicate.pb.h" #include "test/cpp/util/echo.pb.h" #include "src/cpp/util/time.h" +#include "src/cpp/server/thread_pool.h" #include <grpc++/channel_arguments.h> #include <grpc++/channel_interface.h> #include <grpc++/client_context.h> @@ -76,6 +77,7 @@ void MaybeEchoDeadline(ServerContext* context, const EchoRequest* request, response->mutable_param()->set_request_deadline(deadline.tv_sec); } } + } // namespace class TestServiceImpl : public ::grpc::cpp::test::util::TestService::Service { @@ -141,6 +143,8 @@ class TestServiceImplDupPkg class End2endTest : public ::testing::Test { protected: + End2endTest() : thread_pool_(2) {} + void SetUp() override { int port = grpc_pick_unused_port_or_die(); server_address_ << "localhost:" << port; @@ -149,6 +153,7 @@ class End2endTest : public ::testing::Test { builder.AddPort(server_address_.str()); builder.RegisterService(&service_); builder.RegisterService(&dup_pkg_service_); + builder.SetThreadPool(&thread_pool_); server_ = builder.BuildAndStart(); } @@ -165,6 +170,7 @@ class End2endTest : public ::testing::Test { std::ostringstream server_address_; TestServiceImpl service_; TestServiceImplDupPkg dup_pkg_service_; + ThreadPool thread_pool_; }; static void SendRpc(grpc::cpp::test::util::TestService::Stub* stub, |