diff --git a/src/python/grpcio/grpc/experimental/aio/_channel.py b/src/python/grpcio/grpc/experimental/aio/_channel.py index 9e9c7529f34..536206241fe 100644 --- a/src/python/grpcio/grpc/experimental/aio/_channel.py +++ b/src/python/grpcio/grpc/experimental/aio/_channel.py @@ -395,7 +395,7 @@ class Channel: # A new set is created acting as a shallow copy because # when cancellation happens the calls are automatically # removed from the originally set. - calls = frozenset(self._ongoing_calls.calls) + calls = WeakSet(self._ongoing_calls.calls) for call in calls: if call is not None: call.cancel() diff --git a/src/python/grpcio_tests/tests_aio/unit/metadata_test.py b/src/python/grpcio_tests/tests_aio/unit/metadata_test.py index db32add303a..961ec29fceb 100644 --- a/src/python/grpcio_tests/tests_aio/unit/metadata_test.py +++ b/src/python/grpcio_tests/tests_aio/unit/metadata_test.py @@ -210,6 +210,8 @@ class TestMetadata(AioTestBase): self.assertEqual(_RESPONSE, await call) self.assertEqual(grpc.StatusCode.OK, await call.code()) + @unittest.skipIf(platform.system() == 'Windows', + 'https://github.com/grpc/grpc/issues/21943') async def test_invalid_metadata(self): multicallable = self._client.unary_unary(_TEST_CLIENT_TO_SERVER) for exception_type, metadata in _INVALID_METADATA_TEST_CASES: