Fix benchmark shutdown

pull/8008/head
Craig Tiller 8 years ago
parent 1409dbf5ef
commit b019d61f9a
  1. 8
      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:

Loading…
Cancel
Save