diff options
-rw-r--r-- | test/cpp/microbenchmarks/bm_fullstack.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/cpp/microbenchmarks/bm_fullstack.cc b/test/cpp/microbenchmarks/bm_fullstack.cc index 5795c7f4f4..153e9cf1e4 100644 --- a/test/cpp/microbenchmarks/bm_fullstack.cc +++ b/test/cpp/microbenchmarks/bm_fullstack.cc @@ -93,6 +93,15 @@ class FullstackFixture { channel_ = CreateChannel(address, InsecureChannelCredentials()); } + virtual ~FullstackFixture() { + server_->Shutdown(); + cq_->Shutdown(); + void* tag; + bool ok; + while (cq_->Next(&tag, &ok)) { + } + } + ServerCompletionQueue* cq() { return cq_.get(); } std::shared_ptr<Channel> channel() { return channel_; } @@ -169,6 +178,15 @@ class EndpointPairFixture { grpc_exec_ctx_finish(&exec_ctx); } + virtual ~EndpointPairFixture() { + server_->Shutdown(); + cq_->Shutdown(); + void* tag; + bool ok; + while (cq_->Next(&tag, &ok)) { + } + } + ServerCompletionQueue* cq() { return cq_.get(); } std::shared_ptr<Channel> channel() { return channel_; } @@ -260,6 +278,8 @@ static void BM_UnaryPingPong(benchmark::State& state) { service.RequestEcho(&senv->ctx, &senv->recv_request, &senv->response_writer, fixture.cq(), fixture.cq(), tag(slot)); } + server_env[0]->~ServerEnv(); + server_env[1]->~ServerEnv(); } /******************************************************************************* |