From b4d883bfc2e474f928e0f52dd225f69c561966b6 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Tue, 1 Nov 2016 15:10:22 -0700 Subject: [PATCH] Make ASAN pass --- test/cpp/microbenchmarks/bm_fullstack.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/cpp/microbenchmarks/bm_fullstack.cc b/test/cpp/microbenchmarks/bm_fullstack.cc index 5795c7f4f40..153e9cf1e4c 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() { 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() { 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(); } /*******************************************************************************