aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/qps/client_async.cc
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2015-07-01 13:39:48 -0700
committerGravatar Vijay Pai <vpai@google.com>2015-07-01 13:39:48 -0700
commit560619958524aac022b54eb9dec51071684651ed (patch)
tree230eca0ffccfb4d2cb219db0e09117932d50ac7e /test/cpp/qps/client_async.cc
parentf8c63562c1388262c5588e381c05cb0c02e5b406 (diff)
Delete spare contexts lying around at the end of the test to avoid
showing up as memory leaks Also reduce the rate of the openloop test - this may be an issue with sanitizers particularly because of issue #2278
Diffstat (limited to 'test/cpp/qps/client_async.cc')
-rw-r--r--test/cpp/qps/client_async.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc
index 8c8d927d15..7c89a35ee7 100644
--- a/test/cpp/qps/client_async.cc
+++ b/test/cpp/qps/client_async.cc
@@ -199,6 +199,15 @@ class AsyncClient : public Client {
delete ClientRpcContext::detag(got_tag);
}
}
+ // Now clear out all the pre-allocated idle contexts
+ for (int ch = 0; ch < channel_count_; ch++) {
+ if (!contexts_[ch].empty()) {
+ // Get an idle context from the front of the list
+ auto* ctx = *(contexts_[ch].begin());
+ contexts_[ch].pop_front();
+ delete ctx;
+ }
+ }
}
bool ThreadFunc(Histogram* histogram,