From 560619958524aac022b54eb9dec51071684651ed Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 1 Jul 2015 13:39:48 -0700 Subject: 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 --- test/cpp/qps/client_async.cc | 9 +++++++++ test/cpp/qps/qps_test_openloop.cc | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'test/cpp/qps') 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, diff --git a/test/cpp/qps/qps_test_openloop.cc b/test/cpp/qps/qps_test_openloop.cc index 52873b2987..96a9b4504c 100644 --- a/test/cpp/qps/qps_test_openloop.cc +++ b/test/cpp/qps/qps_test_openloop.cc @@ -60,7 +60,7 @@ static void RunQPS() { client_config.set_rpc_type(UNARY); client_config.set_load_type(POISSON); client_config.mutable_load_params()-> - mutable_poisson()->set_offered_load(10000.0); + mutable_poisson()->set_offered_load(1000.0); ServerConfig server_config; server_config.set_server_type(ASYNC_SERVER); -- cgit v1.2.3