aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio_tests/tests/unit/test_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/python/grpcio_tests/tests/unit/test_common.py')
-rw-r--r--src/python/grpcio_tests/tests/unit/test_common.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/python/grpcio_tests/tests/unit/test_common.py b/src/python/grpcio_tests/tests/unit/test_common.py
index ed71cc996b..6334a32b0e 100644
--- a/src/python/grpcio_tests/tests/unit/test_common.py
+++ b/src/python/grpcio_tests/tests/unit/test_common.py
@@ -15,6 +15,7 @@
import collections
+from concurrent import futures
import grpc
import six
@@ -82,3 +83,13 @@ def test_secure_channel(target, channel_credentials, server_host_override):
channel = grpc.secure_channel(target, channel_credentials, (
('grpc.ssl_target_name_override', server_host_override,),))
return channel
+
+
+def test_server(max_workers=10):
+ """Creates an insecure grpc server.
+
+ These servers have SO_REUSEPORT disabled to prevent cross-talk.
+ """
+ return grpc.server(
+ futures.ThreadPoolExecutor(max_workers=max_workers),
+ options=(('grpc.so_reuseport', 0),))