diff --git a/src/python/grpcio_tests/tests/stress/single_thread.cprof b/src/python/grpcio_tests/tests/stress/single_thread.cprof deleted file mode 100644 index 3ae627d1c7b..00000000000 Binary files a/src/python/grpcio_tests/tests/stress/single_thread.cprof and /dev/null differ diff --git a/src/python/grpcio_tests/tests/unit/framework/common/__init__.py b/src/python/grpcio_tests/tests/unit/framework/common/__init__.py index 79b6a603344..e1979c96b09 100644 --- a/src/python/grpcio_tests/tests/unit/framework/common/__init__.py +++ b/src/python/grpcio_tests/tests/unit/framework/common/__init__.py @@ -35,7 +35,11 @@ def get_socket(bind_address='localhost', - the socket object itself """ _sock_options = sock_options if sock_options else [] - for address_family in (socket.AF_INET, socket.AF_INET6): + if socket.has_ipv6: + address_families = (socket.AF_INET6, socket.AF_INET) + else: + address_families = (socket.AF_INET) + for address_family in address_families: try: sock = socket.socket(address_family, socket.SOCK_STREAM) for sock_option in _sock_options: