googleapis / python-pubsub

Apache License 2.0
386 stars 201 forks source link

Update system_test_python_versions to fix "ResourceWarning: unclosed event loop" errors from grpc #1095

Closed mukund-ananthu closed 6 months ago

mukund-ananthu commented 6 months ago
  1. Tests failing after release of grpcio library: https://pypi.org/project/grpcio/1.62.0/#history
  2. Occuring because we use Python 3.10 but grpcio expects Python3.12

Error logs:

             warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E                   pytest.PytestUnraisableExceptionWarning: Exception ignored in: <socket.socket fd=-1, family=1, type=1, proto=0>
E                   
E                   Traceback (most recent call last):
E                     File "src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi", line 184, in grpc._cython.cygrpc.get_working_loop
E                   RuntimeError: no running event loop
E                   
E                   During handling of the above exception, another exception occurred:
E                   
E                   Traceback (most recent call last):
E                     File "src/python/grpcio/grpc/_cython/_cygrpc/aio/common.pyx.pxi", line 190, in grpc._cython.cygrpc.get_working_loop
E                     File "/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/asyncio/events.py", line 697, in get_event_loop
E                       warnings.warn('There is no current event loop',
E                   DeprecationWarning: There is no current event loop
E                   
E                   During handling of the above exception, another exception occurred:
E                   
E                   Traceback (most recent call last):
E                     File "<frozen _collections_abc>", line 804, in get
E                   ResourceWarning: unclosed <socket.socket fd=26, family=1, type=1, proto=0>
  1. Sample failure

  2. Related issue created in grpc repo: https://github.com/grpc/grpc/issues/35974