diff options
author | kpayson64 <kpayson@google.com> | 2018-04-18 15:19:55 -0700 |
---|---|---|
committer | kpayson64 <kpayson@google.com> | 2018-04-18 22:13:09 -0700 |
commit | 7a20c962dfa547a7b7fc1a49e4ff3b2e92eae5e1 (patch) | |
tree | 6540b10a39a1511a5878ce1765a0219c6553ad76 /src/python/grpcio_tests | |
parent | 950d8af7f544c80883e774b9f18b2ef4e3e11039 (diff) |
Break out qps services into seperate protos
Diffstat (limited to 'src/python/grpcio_tests')
5 files changed, 13 insertions, 15 deletions
diff --git a/src/python/grpcio_tests/tests/qps/benchmark_client.py b/src/python/grpcio_tests/tests/qps/benchmark_client.py index e6392a8b8c..0488450740 100644 --- a/src/python/grpcio_tests/tests/qps/benchmark_client.py +++ b/src/python/grpcio_tests/tests/qps/benchmark_client.py @@ -22,7 +22,7 @@ from six.moves import queue import grpc from src.proto.grpc.testing import messages_pb2 -from src.proto.grpc.testing import services_pb2_grpc +from src.proto.grpc.testing import benchmark_service_pb2_grpc from tests.unit import resources from tests.unit import test_common @@ -58,7 +58,8 @@ class BenchmarkClient: if config.payload_config.WhichOneof('payload') == 'simple_params': self._generic = False - self._stub = services_pb2_grpc.BenchmarkServiceStub(channel) + self._stub = benchmark_service_pb2_grpc.BenchmarkServiceStub( + channel) payload = messages_pb2.Payload( body='\0' * config.payload_config.simple_params.req_size) self._request = messages_pb2.SimpleRequest( diff --git a/src/python/grpcio_tests/tests/qps/benchmark_server.py b/src/python/grpcio_tests/tests/qps/benchmark_server.py index bb07844491..2bd89cbbdf 100644 --- a/src/python/grpcio_tests/tests/qps/benchmark_server.py +++ b/src/python/grpcio_tests/tests/qps/benchmark_server.py @@ -13,10 +13,10 @@ # limitations under the License. from src.proto.grpc.testing import messages_pb2 -from src.proto.grpc.testing import services_pb2_grpc +from src.proto.grpc.testing import benchmark_service_pb2_grpc -class BenchmarkServer(services_pb2_grpc.BenchmarkServiceServicer): +class BenchmarkServer(benchmark_service_pb2_grpc.BenchmarkServiceServicer): """Synchronous Server implementation for the Benchmark service.""" def UnaryCall(self, request, context): @@ -29,7 +29,8 @@ class BenchmarkServer(services_pb2_grpc.BenchmarkServiceServicer): yield messages_pb2.SimpleResponse(payload=payload) -class GenericBenchmarkServer(services_pb2_grpc.BenchmarkServiceServicer): +class GenericBenchmarkServer( + benchmark_service_pb2_grpc.BenchmarkServiceServicer): """Generic Server implementation for the Benchmark service.""" def __init__(self, resp_size): diff --git a/src/python/grpcio_tests/tests/qps/qps_worker.py b/src/python/grpcio_tests/tests/qps/qps_worker.py index 54f69db109..c33d013882 100644 --- a/src/python/grpcio_tests/tests/qps/qps_worker.py +++ b/src/python/grpcio_tests/tests/qps/qps_worker.py @@ -17,7 +17,7 @@ import argparse import time import grpc -from src.proto.grpc.testing import services_pb2_grpc +from src.proto.grpc.testing import worker_service_pb2_grpc from tests.qps import worker_server from tests.unit import test_common @@ -26,7 +26,8 @@ from tests.unit import test_common def run_worker_server(port): server = test_common.test_server() servicer = worker_server.WorkerServer() - services_pb2_grpc.add_WorkerServiceServicer_to_server(servicer, server) + worker_service_pb2_grpc.add_WorkerServiceServicer_to_server( + servicer, server) server.add_insecure_port('[::]:{}'.format(port)) server.start() servicer.wait_for_quit() diff --git a/src/python/grpcio_tests/tests/qps/worker_server.py b/src/python/grpcio_tests/tests/qps/worker_server.py index 41e2403c8f..db145fbf64 100644 --- a/src/python/grpcio_tests/tests/qps/worker_server.py +++ b/src/python/grpcio_tests/tests/qps/worker_server.py @@ -20,7 +20,7 @@ import time from concurrent import futures import grpc from src.proto.grpc.testing import control_pb2 -from src.proto.grpc.testing import services_pb2_grpc +from src.proto.grpc.testing import worker_service_pb2_grpc from src.proto.grpc.testing import stats_pb2 from tests.qps import benchmark_client @@ -31,7 +31,7 @@ from tests.unit import resources from tests.unit import test_common -class WorkerServer(services_pb2_grpc.WorkerServiceServicer): +class WorkerServer(worker_service_pb2_grpc.WorkerServiceServicer): """Python Worker Server implementation.""" def __init__(self): @@ -72,7 +72,7 @@ class WorkerServer(services_pb2_grpc.WorkerServiceServicer): server = test_common.test_server(max_workers=server_threads) if config.server_type == control_pb2.ASYNC_SERVER: servicer = benchmark_server.BenchmarkServer() - services_pb2_grpc.add_BenchmarkServiceServicer_to_server( + worker_service_pb2_grpc.add_BenchmarkServiceServicer_to_server( servicer, server) elif config.server_type == control_pb2.ASYNC_GENERIC_SERVER: resp_size = config.payload_config.bytebuf_params.resp_size diff --git a/src/python/grpcio_tests/tests/testing/_server_test.py b/src/python/grpcio_tests/tests/testing/_server_test.py index 4f4abd7708..88e3a79ae5 100644 --- a/src/python/grpcio_tests/tests/testing/_server_test.py +++ b/src/python/grpcio_tests/tests/testing/_server_test.py @@ -21,13 +21,8 @@ import grpc_testing from tests.testing import _application_common from tests.testing import _application_testing_common from tests.testing import _server_application -from tests.testing.proto import services_pb2 -# TODO(https://github.com/google/protobuf/issues/3452): Drop this skip. -@unittest.skipIf( - services_pb2.DESCRIPTOR.services_by_name.get('FirstService') is None, - 'Fix protobuf issue 3452!') class FirstServiceServicerTest(unittest.TestCase): def setUp(self): |