1. Remove all deadlines from the RPCs and shutdown in this code.

These tests (especially unconstrained versions) can get very
   backlogged and may take a while to finish. We sometimes flake waiting
   for that. This is not hazardous (IMO), as the scripts that run these
   tests already have timeouts to make sure that these don't truly go on
   forever.

2. Make the time spent in the benchmark phase actually be
   benchmark_seconds rather than benchmark_seconds-warmup_seconds
   as it is currently.
pull/5752/head
vjpai 9 years ago
parent db3bccade4
commit 63326281d7
  1. 2
      test/cpp/qps/async_streaming_ping_pong_test.cc
  2. 2
      test/cpp/qps/async_unary_ping_pong_test.cc
  3. 17
      test/cpp/qps/driver.cc
  4. 2
      test/cpp/qps/generic_async_streaming_ping_pong_test.cc
  5. 2
      test/cpp/qps/qps_openloop_test.cc
  6. 2
      test/cpp/qps/qps_test.cc
  7. 2
      test/cpp/qps/secure_sync_unary_ping_pong_test.cc
  8. 3
      test/cpp/qps/server_async.cc
  9. 2
      test/cpp/qps/sync_streaming_ping_pong_test.cc
  10. 2
      test/cpp/qps/sync_unary_ping_pong_test.cc

@ -43,7 +43,7 @@ namespace grpc {
namespace testing {
static const int WARMUP = 5;
static const int BENCHMARK = 10;
static const int BENCHMARK = 5;
static void RunAsyncStreamingPingPong() {
gpr_log(GPR_INFO, "Running Async Streaming Ping Pong");

@ -43,7 +43,7 @@ namespace grpc {
namespace testing {
static const int WARMUP = 5;
static const int BENCHMARK = 10;
static const int BENCHMARK = 5;
static void RunAsyncUnaryPingPong() {
gpr_log(GPR_INFO, "Running Async Unary Ping Pong");

@ -43,6 +43,7 @@
#include <grpc/support/alloc.h>
#include <grpc/support/host_port.h>
#include <grpc/support/log.h>
#include <gtest/gtest.h>
#include "src/core/support/env.h"
#include "src/proto/grpc/testing/services.grpc.pb.h"
@ -120,11 +121,9 @@ static deque<string> get_workers(const string& name) {
namespace runsc {
// ClientContext allocator
template <class T>
static ClientContext* AllocContext(list<ClientContext>* contexts, T deadline) {
static ClientContext* AllocContext(list<ClientContext>* contexts) {
contexts->emplace_back();
auto context = &contexts->back();
context->set_deadline(deadline);
return context;
}
@ -196,9 +195,6 @@ std::unique_ptr<ScenarioResult> RunScenario(
// Trim to just what we need
workers.resize(num_clients + num_servers);
gpr_timespec deadline =
GRPC_TIMEOUT_SECONDS_TO_DEADLINE(warmup_seconds + benchmark_seconds + 20);
// Start servers
using runsc::ServerData;
// servers is array rather than std::vector to avoid gcc-4.4 issues
@ -248,7 +244,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
ServerArgs args;
*args.mutable_setup() = server_config;
servers[i].stream =
servers[i].stub->RunServer(runsc::AllocContext(&contexts, deadline));
servers[i].stub->RunServer(runsc::AllocContext(&contexts));
GPR_ASSERT(servers[i].stream->Write(args));
ServerStatus init_status;
GPR_ASSERT(servers[i].stream->Read(&init_status));
@ -304,7 +300,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
ClientArgs args;
*args.mutable_setup() = per_client_config;
clients[i].stream =
clients[i].stub->RunClient(runsc::AllocContext(&contexts, deadline));
clients[i].stub->RunClient(runsc::AllocContext(&contexts));
GPR_ASSERT(clients[i].stream->Write(args));
ClientStatus init_status;
GPR_ASSERT(clients[i].stream->Read(&init_status));
@ -342,7 +338,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
// Use gpr_sleep_until rather than this_thread::sleep_until to support
// compilers that don't work with this_thread
gpr_sleep_until(gpr_time_add(
start, gpr_time_from_seconds(benchmark_seconds, GPR_TIMESPAN)));
start, gpr_time_from_seconds(warmup_seconds + benchmark_seconds,
GPR_TIMESPAN)));
// Finish a run
std::unique_ptr<ScenarioResult> result(new ScenarioResult);
@ -391,7 +388,7 @@ void RunQuit() {
// Get client, server lists
auto workers = get_workers("QPS_WORKERS");
for (size_t i = 0; i < workers.size(); i++) {
auto stub = WorkerService::NewStub(
g auto stub = WorkerService::NewStub(
CreateChannel(workers[i], InsecureChannelCredentials()));
Void dummy;
grpc::ClientContext ctx;

@ -43,7 +43,7 @@ namespace grpc {
namespace testing {
static const int WARMUP = 5;
static const int BENCHMARK = 10;
static const int BENCHMARK = 5;
static void RunGenericAsyncStreamingPingPong() {
gpr_log(GPR_INFO, "Running Generic Async Streaming Ping Pong");

@ -44,7 +44,7 @@ namespace grpc {
namespace testing {
static const int WARMUP = 5;
static const int BENCHMARK = 10;
static const int BENCHMARK = 5;
static void RunQPS() {
gpr_log(GPR_INFO, "Running QPS test, open-loop");

@ -43,7 +43,7 @@ namespace grpc {
namespace testing {
static const int WARMUP = 20;
static const int BENCHMARK = 40;
static const int BENCHMARK = 20;
static void RunQPS() {
gpr_log(GPR_INFO, "Running QPS test");

@ -43,7 +43,7 @@ namespace grpc {
namespace testing {
static const int WARMUP = 5;
static const int BENCHMARK = 10;
static const int BENCHMARK = 5;
static void RunSynchronousUnaryPingPong() {
gpr_log(GPR_INFO, "Running Synchronous Unary Ping Pong");

@ -130,8 +130,7 @@ class AsyncQpsServerTest : public Server {
}
}
~AsyncQpsServerTest() {
auto deadline = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10);
server_->Shutdown(deadline);
server_->Shutdown();
for (auto ss = shutdown_state_.begin(); ss != shutdown_state_.end(); ++ss) {
(*ss)->set_shutdown();
}

@ -43,7 +43,7 @@ namespace grpc {
namespace testing {
static const int WARMUP = 5;
static const int BENCHMARK = 10;
static const int BENCHMARK = 5;
static void RunSynchronousStreamingPingPong() {
gpr_log(GPR_INFO, "Running Synchronous Streaming Ping Pong");

@ -43,7 +43,7 @@ namespace grpc {
namespace testing {
static const int WARMUP = 5;
static const int BENCHMARK = 10;
static const int BENCHMARK = 5;
static void RunSynchronousUnaryPingPong() {
gpr_log(GPR_INFO, "Running Synchronous Unary Ping Pong");

Loading…
Cancel
Save