Supply sock options but still close the socket

pull/23018/head
Lidi Zheng 5 years ago
parent a826ee43a7
commit a275cb1eaa
  1. 4
      src/python/grpcio_tests/tests/unit/_metadata_flags_test.py

@ -102,7 +102,7 @@ class _GenericHandler(grpc.GenericRpcHandler):
def create_dummy_channel():
"""Creating dummy channels is a workaround for retries"""
host, port, sock = get_socket()
host, port, sock = get_socket(sock_options=(socket.SO_REUSEADDR,))
sock.close()
return grpc.insecure_channel('{}:{}'.format(host, port))
@ -207,7 +207,7 @@ class MetadataFlagsTest(unittest.TestCase):
unhandled_exceptions = queue.Queue()
# We just need an unused TCP port
host, port, sock = get_socket()
host, port, sock = get_socket(sock_options=(socket.SO_REUSEADDR,))
sock.close()
addr = '{}:{}'.format(host, port)

Loading…
Cancel
Save