From f797c651609c4a99b13ad8b0c3bf2b82eb189b15 Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Wed, 8 Feb 2017 14:29:30 -0800 Subject: [PATCH] make the change in scenario config rather than c# --- src/csharp/Grpc.IntegrationTesting/ServerRunners.cs | 3 ++- src/proto/grpc/testing/control.proto | 5 ++++- tools/run_tests/performance/scenario_config.py | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs b/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs index 4591b72cbaa..8689d188aed 100644 --- a/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs +++ b/src/csharp/Grpc.IntegrationTesting/ServerRunners.cs @@ -79,7 +79,8 @@ namespace Grpc.IntegrationTesting ServerServiceDefinition service = null; if (config.ServerType == ServerType.AsyncServer) { - Logger.Warning("ServerConfig.PayloadConfig is not supported for C# ServerType.AsyncServer. Ignoring the value"); + GrpcPreconditions.CheckArgument(config.PayloadConfig == null, + "ServerConfig.PayloadConfig shouldn't be set for BenchmarkService based server."); service = BenchmarkService.BindService(new BenchmarkServiceImpl()); } else if (config.ServerType == ServerType.AsyncGenericServer) diff --git a/src/proto/grpc/testing/control.proto b/src/proto/grpc/testing/control.proto index 529313cfb1e..8f0d25c2c96 100644 --- a/src/proto/grpc/testing/control.proto +++ b/src/proto/grpc/testing/control.proto @@ -139,7 +139,10 @@ message ServerConfig { int32 async_server_threads = 7; // Specify the number of cores to limit server to, if desired int32 core_limit = 8; - // payload config, used in generic server + // payload config, used in generic server. + // Note this must NOT be used in proto (non-generic) servers. For proto servers, + // 'response sizes' must be configured from the 'response_size' field of the + // 'SimpleRequest' objects in RPC requests. PayloadConfig payload_config = 9; // Specify the cores we should run the server on, if desired diff --git a/tools/run_tests/performance/scenario_config.py b/tools/run_tests/performance/scenario_config.py index 6d138186ced..865125fcd78 100644 --- a/tools/run_tests/performance/scenario_config.py +++ b/tools/run_tests/performance/scenario_config.py @@ -143,8 +143,9 @@ def _ping_pong_scenario(name, rpc_type, if use_generic_payload: if server_type != 'ASYNC_GENERIC_SERVER': raise Exception('Use ASYNC_GENERIC_SERVER for generic payload.') + scenario['server_config']['payload_config'] = _payload_type(use_generic_payload, req_size, resp_size) + scenario['client_config']['payload_config'] = _payload_type(use_generic_payload, req_size, resp_size) - scenario['server_config']['payload_config'] = _payload_type(use_generic_payload, req_size, resp_size) if unconstrained_client: outstanding_calls = outstanding if outstanding is not None else OUTSTANDING_REQUESTS[unconstrained_client]