Address some review comments about signal and restoring qps_test_with_poll
Make payloads respect the new defaults
diff --git a/test/cpp/qps/async_streaming_ping_pong_test.cc b/test/cpp/qps/async_streaming_ping_pong_test.cc
index 9aa7f88..9fef93a 100644
--- a/test/cpp/qps/async_streaming_ping_pong_test.cc
+++ b/test/cpp/qps/async_streaming_ping_pong_test.cc
@@ -35,8 +35,6 @@
 
 #include <grpc/support/log.h>
 
-#include <signal.h>
-
 #include "test/cpp/qps/driver.h"
 #include "test/cpp/qps/report.h"
 #include "test/cpp/util/benchmark_config.h"
@@ -54,9 +52,6 @@
   client_config.set_client_type(ASYNC_CLIENT);
   client_config.set_outstanding_rpcs_per_channel(1);
   client_config.set_client_channels(1);
-  client_config.mutable_payload_config()
-      ->mutable_simple_params()
-      ->set_resp_size(1);
   client_config.set_async_client_threads(1);
   client_config.set_rpc_type(STREAMING);
   client_config.mutable_load_params()->mutable_closed_loop();
@@ -78,7 +73,6 @@
 int main(int argc, char** argv) {
   grpc::testing::InitBenchmark(&argc, &argv, true);
 
-  signal(SIGPIPE, SIG_IGN);
   grpc::testing::RunAsyncStreamingPingPong();
   return 0;
 }
diff --git a/test/cpp/qps/async_unary_ping_pong_test.cc b/test/cpp/qps/async_unary_ping_pong_test.cc
index fe2cde0..b4ab0e5 100644
--- a/test/cpp/qps/async_unary_ping_pong_test.cc
+++ b/test/cpp/qps/async_unary_ping_pong_test.cc
@@ -35,8 +35,6 @@
 
 #include <grpc/support/log.h>
 
-#include <signal.h>
-
 #include "test/cpp/qps/driver.h"
 #include "test/cpp/qps/report.h"
 #include "test/cpp/util/benchmark_config.h"
@@ -54,9 +52,6 @@
   client_config.set_client_type(ASYNC_CLIENT);
   client_config.set_outstanding_rpcs_per_channel(1);
   client_config.set_client_channels(1);
-  client_config.mutable_payload_config()
-      ->mutable_simple_params()
-      ->set_resp_size(1);
   client_config.set_async_client_threads(1);
   client_config.set_rpc_type(UNARY);
   client_config.mutable_load_params()->mutable_closed_loop();
@@ -76,7 +71,6 @@
 
 int main(int argc, char** argv) {
   grpc::testing::InitBenchmark(&argc, &argv, true);
-  signal(SIGPIPE, SIG_IGN);
 
   grpc::testing::RunAsyncUnaryPingPong();
   return 0;
diff --git a/test/cpp/qps/client.h b/test/cpp/qps/client.h
index 027e0d4..f440069 100644
--- a/test/cpp/qps/client.h
+++ b/test/cpp/qps/client.h
@@ -90,7 +90,11 @@
     } else if (config.payload_config().has_complex_params()) {
       GPR_ASSERT(false);  // not yet implemented
     } else {
-      GPR_ASSERT(false);  // badly configured
+      // default should be simple proto without payloads
+      request_.set_response_type(grpc::testing::PayloadType::COMPRESSABLE);
+      request_.set_response_size(0);
+      request_.mutable_payload()->set_type(
+          grpc::testing::PayloadType::COMPRESSABLE);
     }
   }
   virtual ~Client() {}
@@ -176,23 +180,29 @@
     const auto& load = config.load_params();
 
     std::unique_ptr<RandomDist> random_dist;
-    if (load.has_poisson()) {
+    switch (load.load_case()) {
+    case LoadParams::kClosedLoop:
+      // Closed-loop doesn't use random dist at all
+      break;
+    case LoadParams::kPoisson:
       random_dist.reset(
           new ExpDist(load.poisson().offered_load() / num_threads));
-    } else if (load.has_uniform()) {
+      break;
+    case LoadParams::kUniform:
       random_dist.reset(
           new UniformDist(load.uniform().interarrival_lo() * num_threads,
                           load.uniform().interarrival_hi() * num_threads));
-    } else if (load.has_determ()) {
+      break;
+    case LoadParams::kDeterm:
       random_dist.reset(
           new DetDist(num_threads / load.determ().offered_load()));
-    } else if (load.has_pareto()) {
+      break;
+    case LoadParams::kPareto:
       random_dist.reset(
           new ParetoDist(load.pareto().interarrival_base() * num_threads,
                          load.pareto().alpha()));
-    } else if (load.has_closed_loop()) {
-      // Closed-loop doesn't use random dist at all
-    } else {  // invalid load type
+      break;
+    default:
       GPR_ASSERT(false);
     }
 
diff --git a/test/cpp/qps/qps_driver.cc b/test/cpp/qps/qps_driver.cc
index cdcd808..4c93a04 100644
--- a/test/cpp/qps/qps_driver.cc
+++ b/test/cpp/qps/qps_driver.cc
@@ -33,7 +33,6 @@
 
 #include <memory>
 #include <set>
-#include <signal.h>
 
 #include <gflags/gflags.h>
 #include <grpc/support/log.h>
@@ -167,7 +166,6 @@
 int main(int argc, char** argv) {
   grpc::testing::InitBenchmark(&argc, &argv, true);
 
-  signal(SIGPIPE, SIG_IGN);
   grpc::testing::QpsDriver();
 
   return 0;
diff --git a/test/cpp/qps/qps_openloop_test.cc b/test/cpp/qps/qps_openloop_test.cc
index fbd9558..dc88c89 100644
--- a/test/cpp/qps/qps_openloop_test.cc
+++ b/test/cpp/qps/qps_openloop_test.cc
@@ -31,8 +31,6 @@
  *
  */
 
-#include <signal.h>
-
 #include <set>
 
 #include <grpc/support/log.h>
@@ -54,9 +52,6 @@
   client_config.set_client_type(ASYNC_CLIENT);
   client_config.set_outstanding_rpcs_per_channel(1000);
   client_config.set_client_channels(8);
-  client_config.mutable_payload_config()
-      ->mutable_simple_params()
-      ->set_resp_size(1);
   client_config.set_async_client_threads(8);
   client_config.set_rpc_type(UNARY);
   client_config.mutable_load_params()->mutable_poisson()->set_offered_load(
@@ -79,7 +74,6 @@
 int main(int argc, char** argv) {
   grpc::testing::InitBenchmark(&argc, &argv, true);
 
-  signal(SIGPIPE, SIG_IGN);
   grpc::testing::RunQPS();
 
   return 0;
diff --git a/test/cpp/qps/qps_test.cc b/test/cpp/qps/qps_test.cc
index de81d99..89b35cf 100644
--- a/test/cpp/qps/qps_test.cc
+++ b/test/cpp/qps/qps_test.cc
@@ -31,8 +31,6 @@
  *
  */
 
-#include <signal.h>
-
 #include <set>
 
 #include <grpc/support/log.h>
@@ -54,9 +52,6 @@
   client_config.set_client_type(ASYNC_CLIENT);
   client_config.set_outstanding_rpcs_per_channel(1000);
   client_config.set_client_channels(8);
-  client_config.mutable_payload_config()
-      ->mutable_simple_params()
-      ->set_resp_size(1);
   client_config.set_async_client_threads(8);
   client_config.set_rpc_type(UNARY);
   client_config.mutable_load_params()->mutable_closed_loop();
@@ -78,7 +73,6 @@
 int main(int argc, char** argv) {
   grpc::testing::InitBenchmark(&argc, &argv, true);
 
-  signal(SIGPIPE, SIG_IGN);
   grpc::testing::RunQPS();
 
   return 0;
diff --git a/test/cpp/qps/qps_test_with_poll.cc b/test/cpp/qps/qps_test_with_poll.cc
new file mode 100644
index 0000000..97da409
--- /dev/null
+++ b/test/cpp/qps/qps_test_with_poll.cc
@@ -0,0 +1,85 @@
+/*
+ *
+ * Copyright 2015, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <set>
+
+#include <grpc/support/log.h>
+
+#include "test/cpp/qps/driver.h"
+#include "test/cpp/qps/report.h"
+#include "test/cpp/util/benchmark_config.h"
+
+extern "C" {
+#include "src/core/iomgr/pollset_posix.h"
+}
+
+namespace grpc {
+namespace testing {
+
+static const int WARMUP = 5;
+static const int BENCHMARK = 5;
+
+static void RunQPS() {
+  gpr_log(GPR_INFO, "Running QPS test");
+
+  ClientConfig client_config;
+  client_config.set_client_type(ASYNC_CLIENT);
+  client_config.set_outstanding_rpcs_per_channel(1000);
+  client_config.set_client_channels(8);
+  client_config.set_async_client_threads(8);
+  client_config.set_rpc_type(UNARY);
+  client_config.mutable_load_params()->mutable_closed_loop();
+
+  ServerConfig server_config;
+  server_config.set_server_type(ASYNC_SERVER);
+  server_config.set_async_server_threads(4);
+
+  const auto result =
+      RunScenario(client_config, 1, server_config, 1, WARMUP, BENCHMARK, -2);
+
+  GetReporter()->ReportQPSPerCore(*result);
+  GetReporter()->ReportLatency(*result);
+}
+
+}  // namespace testing
+}  // namespace grpc
+
+int main(int argc, char** argv) {
+  grpc::testing::InitBenchmark(&argc, &argv, true);
+
+  grpc_platform_become_multipoller = grpc_poll_become_multipoller;
+
+  grpc::testing::RunQPS();
+
+  return 0;
+}
diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc
index 8af6fd0..dc59eab 100644
--- a/test/cpp/qps/qps_worker.cc
+++ b/test/cpp/qps/qps_worker.cc
@@ -199,8 +199,8 @@
       return Status(StatusCode::INVALID_ARGUMENT, "");
     }
     ServerStatus status;
-    status.set_port(server->Port());
-    status.set_cores(server->Cores());
+    status.set_port(server->port());
+    status.set_cores(server->cores());
     if (!stream->Write(status)) {
       return Status(StatusCode::UNKNOWN, "");
     }
diff --git a/test/cpp/qps/secure_sync_unary_ping_pong_test.cc b/test/cpp/qps/secure_sync_unary_ping_pong_test.cc
index 874b747..df06f7e 100644
--- a/test/cpp/qps/secure_sync_unary_ping_pong_test.cc
+++ b/test/cpp/qps/secure_sync_unary_ping_pong_test.cc
@@ -31,8 +31,6 @@
  *
  */
 
-#include <signal.h>
-
 #include <set>
 
 #include <grpc/support/log.h>
@@ -54,9 +52,6 @@
   client_config.set_client_type(SYNC_CLIENT);
   client_config.set_outstanding_rpcs_per_channel(1);
   client_config.set_client_channels(1);
-  client_config.mutable_payload_config()
-      ->mutable_simple_params()
-      ->set_resp_size(1);
   client_config.set_rpc_type(UNARY);
   client_config.mutable_load_params()->mutable_closed_loop();
 
@@ -83,7 +78,6 @@
 int main(int argc, char** argv) {
   grpc::testing::InitBenchmark(&argc, &argv, true);
 
-  signal(SIGPIPE, SIG_IGN);
   grpc::testing::RunSynchronousUnaryPingPong();
 
   return 0;
diff --git a/test/cpp/qps/server.h b/test/cpp/qps/server.h
index 0309cb5..6e81edc 100644
--- a/test/cpp/qps/server.h
+++ b/test/cpp/qps/server.h
@@ -86,8 +86,8 @@
     return true;
   }
 
-  int Port() const { return port_; }
-  int Cores() const { return gpr_cpu_num_cores(); }
+  int port() const { return port_; }
+  int cores() const { return gpr_cpu_num_cores(); }
   static std::shared_ptr<ServerCredentials> CreateServerCredentials(
       const ServerConfig& config) {
     if (config.has_security_params()) {
diff --git a/test/cpp/qps/server_async.cc b/test/cpp/qps/server_async.cc
index 40f9dd3..2d922fa 100644
--- a/test/cpp/qps/server_async.cc
+++ b/test/cpp/qps/server_async.cc
@@ -60,7 +60,7 @@
   explicit AsyncQpsServerTest(const ServerConfig &config) : Server(config) {
     char *server_address = NULL;
 
-    gpr_join_host_port(&server_address, "::", Port());
+    gpr_join_host_port(&server_address, "::", port());
 
     ServerBuilder builder;
     builder.AddListeningPort(server_address,
diff --git a/test/cpp/qps/server_sync.cc b/test/cpp/qps/server_sync.cc
index 9f06b44..a09b174 100644
--- a/test/cpp/qps/server_sync.cc
+++ b/test/cpp/qps/server_sync.cc
@@ -89,7 +89,7 @@
 
     char* server_address = NULL;
 
-    gpr_join_host_port(&server_address, "::", Port());
+    gpr_join_host_port(&server_address, "::", port());
     builder.AddListeningPort(server_address,
                              Server::CreateServerCredentials(config));
     gpr_free(server_address);
diff --git a/test/cpp/qps/sync_streaming_ping_pong_test.cc b/test/cpp/qps/sync_streaming_ping_pong_test.cc
index 250e8eb..186afc0 100644
--- a/test/cpp/qps/sync_streaming_ping_pong_test.cc
+++ b/test/cpp/qps/sync_streaming_ping_pong_test.cc
@@ -31,8 +31,6 @@
  *
  */
 
-#include <signal.h>
-
 #include <set>
 
 #include <grpc/support/log.h>
@@ -54,9 +52,6 @@
   client_config.set_client_type(SYNC_CLIENT);
   client_config.set_outstanding_rpcs_per_channel(1);
   client_config.set_client_channels(1);
-  client_config.mutable_payload_config()
-      ->mutable_simple_params()
-      ->set_resp_size(1);
   client_config.set_rpc_type(STREAMING);
   client_config.mutable_load_params()->mutable_closed_loop();
 
@@ -75,7 +70,6 @@
 int main(int argc, char** argv) {
   grpc::testing::InitBenchmark(&argc, &argv, true);
 
-  signal(SIGPIPE, SIG_IGN);
   grpc::testing::RunSynchronousStreamingPingPong();
 
   return 0;
diff --git a/test/cpp/qps/sync_unary_ping_pong_test.cc b/test/cpp/qps/sync_unary_ping_pong_test.cc
index 4defcf3..2585183 100644
--- a/test/cpp/qps/sync_unary_ping_pong_test.cc
+++ b/test/cpp/qps/sync_unary_ping_pong_test.cc
@@ -31,8 +31,6 @@
  *
  */
 
-#include <signal.h>
-
 #include <set>
 
 #include <grpc/support/log.h>
@@ -54,9 +52,6 @@
   client_config.set_client_type(SYNC_CLIENT);
   client_config.set_outstanding_rpcs_per_channel(1);
   client_config.set_client_channels(1);
-  client_config.mutable_payload_config()
-      ->mutable_simple_params()
-      ->set_resp_size(1);
   client_config.set_rpc_type(UNARY);
   client_config.mutable_load_params()->mutable_closed_loop();
 
@@ -76,7 +71,6 @@
 int main(int argc, char** argv) {
   grpc::testing::InitBenchmark(&argc, &argv, true);
 
-  signal(SIGPIPE, SIG_IGN);
   grpc::testing::RunSynchronousUnaryPingPong();
 
   return 0;