diff options
Diffstat (limited to 'test/cpp/thread_manager')
-rw-r--r-- | test/cpp/thread_manager/BUILD | 31 | ||||
-rw-r--r-- | test/cpp/thread_manager/thread_manager_test.cc | 8 |
2 files changed, 4 insertions, 35 deletions
diff --git a/test/cpp/thread_manager/BUILD b/test/cpp/thread_manager/BUILD deleted file mode 100644 index 1f0878770b..0000000000 --- a/test/cpp/thread_manager/BUILD +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright 2017 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -licenses(["notice"]) # Apache v2 - -load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package") - -grpc_package(name = "test/cpp/thread_manager") - -grpc_cc_test( - name = "thread_manager_test", - srcs = ["thread_manager_test.cc"], - deps = [ - "//:gpr", - "//:grpc", - "//:grpc++", - "//test/cpp/util:test_config", - ], -) - diff --git a/test/cpp/thread_manager/thread_manager_test.cc b/test/cpp/thread_manager/thread_manager_test.cc index d3d31f9dd9..8282d46694 100644 --- a/test/cpp/thread_manager/thread_manager_test.cc +++ b/test/cpp/thread_manager/thread_manager_test.cc @@ -20,10 +20,10 @@ #include <memory> #include <string> +#include <gflags/gflags.h> #include <grpc++/grpc++.h> #include <grpc/support/log.h> #include <grpc/support/port_platform.h> -#include <grpc/support/thd.h> #include "src/cpp/thread_manager/thread_manager.h" #include "test/cpp/util/test_config.h" @@ -32,13 +32,13 @@ namespace grpc { class ThreadManagerTest final : public grpc::ThreadManager { public: ThreadManagerTest() - : ThreadManager(kMinPollers, kMaxPollers, gpr_thd_new, gpr_thd_join), + : ThreadManager(kMinPollers, kMaxPollers), num_do_work_(0), num_poll_for_work_(0), num_work_found_(0) {} grpc::ThreadManager::WorkStatus PollForWork(void** tag, bool* ok) override; - void DoWork(void* tag, bool ok, bool resources) override; + void DoWork(void* tag, bool ok) override; void PerformTest(); private: @@ -89,7 +89,7 @@ grpc::ThreadManager::WorkStatus ThreadManagerTest::PollForWork(void** tag, } } -void ThreadManagerTest::DoWork(void* tag, bool ok, bool resources) { +void ThreadManagerTest::DoWork(void* tag, bool ok) { gpr_atm_no_barrier_fetch_add(&num_do_work_, 1); SleepForMs(kDoWorkDurationMsec); // Simulate doing work by sleeping } |