Put timeout on server shutdown

This commit is contained in:
vjpai 2015-08-31 16:27:35 -07:00
parent 4668600d11
commit d514b21cc8
1 changed files with 3 additions and 1 deletions

View File

@ -101,7 +101,9 @@ class AsyncQpsServerTest : public Server {
}
}
~AsyncQpsServerTest() {
server_->Shutdown();
auto deadline = std::chrono::high_resolution_clock::now() +
std::chrono::seconds(10);
server_->Shutdown(deadline);
for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) {
(*ss)->set_shutdown();
}