Uploaded image for project: 'Python Driver'
  1. Python Driver
  2. PYTHON-4613

Eventlet tests failing with Runner.run() cannot be called from a running event loop

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 4.9
    • Affects Version/s: None
    • Component/s: None
    • None
    • Python Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      PYTHON-4565 caused the Eventlet tests to start failing with:

       [2024/07/25 07:50:27.496] FAILURE: RuntimeError: Runner.run() cannot be called from a running event loop ()
       [2024/07/25 07:50:27.496] /opt/python/3.12/lib/python3.12/unittest/async_case.py:95: in _callTearDown
       [2024/07/25 07:50:27.496]     self._callAsync(self.asyncTearDown)
       [2024/07/25 07:50:27.496] /opt/python/3.12/lib/python3.12/unittest/async_case.py:104: in _callAsync
       [2024/07/25 07:50:27.496]     return self._asyncioRunner.run(
       [2024/07/25 07:50:27.496] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
       [2024/07/25 07:50:27.496] self = <asyncio.runners.Runner object at 0x7f92be716b10>
       [2024/07/25 07:50:27.496] coro = <coroutine object IsolatedAsyncioTestCase.asyncTearDown at 0x7f92bce36d40>
       [2024/07/25 07:50:27.496]     def run(self, coro, *, context=None):
       [2024/07/25 07:50:27.496]         """Run a coroutine inside the embedded event loop."""
       [2024/07/25 07:50:27.496]         if not coroutines.iscoroutine(coro):
       [2024/07/25 07:50:27.496]             raise ValueError("a coroutine was expected, got {!r}".format(coro))
       [2024/07/25 07:50:27.496]     
       [2024/07/25 07:50:27.496]         if events._get_running_loop() is not None:
       [2024/07/25 07:50:27.496]             # fail fast with short traceback
       [2024/07/25 07:50:27.496] >           raise RuntimeError(
       [2024/07/25 07:50:27.496]                 "Runner.run() cannot be called from a running event loop")
       [2024/07/25 07:50:27.496] E           RuntimeError: Runner.run() cannot be called from a running event loop
       [2024/07/25 07:50:27.496] /opt/python/3.12/lib/python3.12/asyncio/runners.py:93: RuntimeError
      

      https://spruce.mongodb.com/task/mongo_python_driver_tests_python_version_green_framework_rhel8__platform~rhel8_auth_ssl~noauth_nossl_python_version~3.12_green_framework~eventlet_test_3.6_standalone_993171cd3d94b9e42476c522bf35d076cf074112_24_07_23_19_28_55?execution=0&sortBy=STATUS&sortDir=ASC

      We should skip the async tests when testing eventlet and gevent.

            Assignee:
            noah.stapp@mongodb.com Noah Stapp
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: