From a6b5e5c73add6717f43f84359791d606932c05c3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 4 Nov 2020 15:42:11 +0100 Subject: [PATCH] make qps_worker --server_port behavior consistent with java --- test/cpp/qps/qps_worker.cc | 2 +- test/cpp/qps/worker.cc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/cpp/qps/qps_worker.cc b/test/cpp/qps/qps_worker.cc index 950ef3e2c5e..54a1b20baee 100644 --- a/test/cpp/qps/qps_worker.cc +++ b/test/cpp/qps/qps_worker.cc @@ -234,7 +234,7 @@ class WorkerServiceImpl final : public WorkerService::Service { if (!args.has_setup()) { return Status(StatusCode::INVALID_ARGUMENT, "Bad server creation args"); } - if (server_port_ > 0) { + if (server_port_ > 0 && args.setup().port() == 0) { args.mutable_setup()->set_port(server_port_); } gpr_log(GPR_INFO, "RunServerBody: about to create server"); diff --git a/test/cpp/qps/worker.cc b/test/cpp/qps/worker.cc index c88b60e2f10..f91cb8b8699 100644 --- a/test/cpp/qps/worker.cc +++ b/test/cpp/qps/worker.cc @@ -32,7 +32,9 @@ #include "test/cpp/util/test_credentials_provider.h" DEFINE_int32(driver_port, 0, "Port for communication with driver"); -DEFINE_int32(server_port, 0, "Port for operation as a server"); +DEFINE_int32(server_port, 0, + "Port for operation as a server, if not specified by the server " + "config message."); DEFINE_string(credential_type, grpc::testing::kInsecureCredentialsType, "Credential type for communication with driver");