From d9c0d498f224366263b0fc7cff9752eec48172cd Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Mon, 26 Aug 2019 11:33:44 -0700 Subject: [PATCH 1/5] Stop the failing tests --- src/python/grpcio_tests/commands.py | 5 ++++- .../grpcio_tests/tests/unit/_local_credentials_test.py | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index 61d8bdc1f7b..d30daacd5ac 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -160,7 +160,10 @@ class TestGevent(setuptools.Command): ) BANNED_WINDOWS_TESTS = ( # TODO(https://github.com/grpc/grpc/pull/15411) enable this test - 'unit._dns_resolver_test.DNSResolverTest.test_connect_loopback',) + 'unit._dns_resolver_test.DNSResolverTest.test_connect_loopback', + # TODO(https://github.com/grpc/grpc/issues/20078) enable this test + 'unit._local_credentials_test.LocalCredentialsTest', + ) description = 'run tests with gevent. Assumes grpc/gevent are installed' user_options = [] diff --git a/src/python/grpcio_tests/tests/unit/_local_credentials_test.py b/src/python/grpcio_tests/tests/unit/_local_credentials_test.py index 80a21af1cef..14b68cb5907 100644 --- a/src/python/grpcio_tests/tests/unit/_local_credentials_test.py +++ b/src/python/grpcio_tests/tests/unit/_local_credentials_test.py @@ -49,6 +49,8 @@ class LocalCredentialsTest(unittest.TestCase): b'abc', wait_for_ready=True)) server.stop(None) + @unittest.skipIf(os.name == 'nt', + 'Unix Domain Socket is not supported on Windows') def test_uds(self): server_addr = 'unix:/tmp/grpc_fullstack_test' channel_creds = grpc.local_channel_credentials( From 750a8ab6ca22e85df38d3d54845ac489c94ac0df Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Mon, 26 Aug 2019 12:05:21 -0700 Subject: [PATCH 2/5] Fix import --- src/python/grpcio_tests/tests/unit/_local_credentials_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/python/grpcio_tests/tests/unit/_local_credentials_test.py b/src/python/grpcio_tests/tests/unit/_local_credentials_test.py index 14b68cb5907..8690505b861 100644 --- a/src/python/grpcio_tests/tests/unit/_local_credentials_test.py +++ b/src/python/grpcio_tests/tests/unit/_local_credentials_test.py @@ -14,6 +14,7 @@ """Test of RPCs made using local credentials.""" import unittest +import os from concurrent.futures import ThreadPoolExecutor import grpc From 8f403431a153b75665f8d737489862e9e1460aff Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Mon, 26 Aug 2019 13:57:20 -0700 Subject: [PATCH 3/5] Try to disable it again --- src/python/grpcio_tests/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index d30daacd5ac..2ea6de28bb7 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -162,7 +162,7 @@ class TestGevent(setuptools.Command): # TODO(https://github.com/grpc/grpc/pull/15411) enable this test 'unit._dns_resolver_test.DNSResolverTest.test_connect_loopback', # TODO(https://github.com/grpc/grpc/issues/20078) enable this test - 'unit._local_credentials_test.LocalCredentialsTest', + 'unit._local_credentials_test.LocalCredentialsTest.test_local_tcp', ) description = 'run tests with gevent. Assumes grpc/gevent are installed' user_options = [] From 630e6ab2212a99c26f4cda89f1459a0205f70763 Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Mon, 26 Aug 2019 15:55:42 -0700 Subject: [PATCH 4/5] Use the correct machanism to ignore test in Windows --- src/python/grpcio_tests/commands.py | 4 +--- src/python/grpcio_tests/tests/unit/_local_credentials_test.py | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index 2ea6de28bb7..3758d995a97 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -161,8 +161,6 @@ class TestGevent(setuptools.Command): BANNED_WINDOWS_TESTS = ( # TODO(https://github.com/grpc/grpc/pull/15411) enable this test 'unit._dns_resolver_test.DNSResolverTest.test_connect_loopback', - # TODO(https://github.com/grpc/grpc/issues/20078) enable this test - 'unit._local_credentials_test.LocalCredentialsTest.test_local_tcp', ) description = 'run tests with gevent. Assumes grpc/gevent are installed' user_options = [] @@ -189,7 +187,7 @@ class TestGevent(setuptools.Command): loader = tests.Loader() loader.loadTestsFromNames(['tests']) runner = tests.Runner() - if sys.platform == 'win32': + if os.name == 'nt': runner.skip_tests(self.BANNED_TESTS + self.BANNED_WINDOWS_TESTS) else: runner.skip_tests(self.BANNED_TESTS) diff --git a/src/python/grpcio_tests/tests/unit/_local_credentials_test.py b/src/python/grpcio_tests/tests/unit/_local_credentials_test.py index 8690505b861..7f3e8cc41c9 100644 --- a/src/python/grpcio_tests/tests/unit/_local_credentials_test.py +++ b/src/python/grpcio_tests/tests/unit/_local_credentials_test.py @@ -33,6 +33,8 @@ class LocalCredentialsTest(unittest.TestCase): server.add_generic_rpc_handlers((_GenericHandler(),)) return server + @unittest.skipIf(os.name == 'nt', + 'TODO(https://github.com/grpc/grpc/issues/20078)') def test_local_tcp(self): server_addr = 'localhost:{}' channel_creds = grpc.local_channel_credentials( From a2990a053cdeb1737062b11188a1357a18441f62 Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Mon, 26 Aug 2019 15:57:02 -0700 Subject: [PATCH 5/5] Revert changes in src/python/grpcio_tests/commands.py --- src/python/grpcio_tests/commands.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/python/grpcio_tests/commands.py b/src/python/grpcio_tests/commands.py index 3758d995a97..61d8bdc1f7b 100644 --- a/src/python/grpcio_tests/commands.py +++ b/src/python/grpcio_tests/commands.py @@ -160,8 +160,7 @@ class TestGevent(setuptools.Command): ) BANNED_WINDOWS_TESTS = ( # TODO(https://github.com/grpc/grpc/pull/15411) enable this test - 'unit._dns_resolver_test.DNSResolverTest.test_connect_loopback', - ) + 'unit._dns_resolver_test.DNSResolverTest.test_connect_loopback',) description = 'run tests with gevent. Assumes grpc/gevent are installed' user_options = [] @@ -187,7 +186,7 @@ class TestGevent(setuptools.Command): loader = tests.Loader() loader.loadTestsFromNames(['tests']) runner = tests.Runner() - if os.name == 'nt': + if sys.platform == 'win32': runner.skip_tests(self.BANNED_TESTS + self.BANNED_WINDOWS_TESTS) else: runner.skip_tests(self.BANNED_TESTS)