aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/server_async.cc
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-10-17 13:23:51 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-10-17 13:23:51 -0700
commitb019d61f9a289e2f2f9323b55e4734f612649571 (patch)
treef71bc0b6ff5f461928c4421638732671ca0a9a28 /test/cpp/qps/server_async.cc
parent1409dbf5efaf5e9eb9d98e6eefeac460ee3ca2d4 (diff)
Fix benchmark shutdown
Diffstat (limited to 'test/cpp/qps/server_async.cc')
-rw-r--r--test/cpp/qps/server_async.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index 082b4bc72f..191c6566ad 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -132,8 +132,11 @@ class AsyncQpsServerTest : public Server {
(*ss)->shutdown = true;
}
// TODO (vpai): Remove this deadline and allow Shutdown to finish properly
- auto deadline = std::chrono::system_clock::now() + std::chrono::seconds(3);
- server_->Shutdown(deadline);
+ std::thread shutdown_thread([this]() {
+ auto deadline =
+ std::chrono::system_clock::now() + std::chrono::seconds(3);
+ server_->Shutdown(deadline);
+ });
for (auto cq = srv_cqs_.begin(); cq != srv_cqs_.end(); ++cq) {
(*cq)->Shutdown();
}
@@ -146,6 +149,7 @@ class AsyncQpsServerTest : public Server {
while ((*cq)->Next(&got_tag, &ok))
;
}
+ shutdown_thread.join();
}
private: