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

Test Failure - coroutine 'AsyncClientContext._check_user_provided' was never awaited

    • 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?

      AsyncTestCollection.test_insert_many_large_batch fails with RuntimeWarning: coroutine 'AsyncClientContext._check_user_provided' was never awaited:

       [2024/07/04 07:04:58.506] =================================== FAILURES ===================================
       [2024/07/04 07:04:58.506] _______________ AsyncTestCollection.test_insert_many_large_batch _______________
       [2024/07/04 07:04:58.506] cls = <class '_pytest.runner.CallInfo'>
       [2024/07/04 07:04:58.506] func = <function call_and_report.<locals>.<lambda> at 0x0000000003954160>
       [2024/07/04 07:04:58.506] when = 'call'
       [2024/07/04 07:04:58.506] reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
       [2024/07/04 07:04:58.506]     @classmethod
       [2024/07/04 07:04:58.506]     def from_call(
       [2024/07/04 07:04:58.506]         cls,
       [2024/07/04 07:04:58.506]         func: Callable[[], TResult],
       [2024/07/04 07:04:58.506]         when: Literal["collect", "setup", "call", "teardown"],
       [2024/07/04 07:04:58.506]         reraise: Optional[
       [2024/07/04 07:04:58.506]             Union[Type[BaseException], Tuple[Type[BaseException], ...]]
       [2024/07/04 07:04:58.506]         ] = None,
       [2024/07/04 07:04:58.506]     ) -> "CallInfo[TResult]":
       [2024/07/04 07:04:58.506]         """Call func, wrapping the result in a CallInfo.
       [2024/07/04 07:04:58.506]         :param func:
       [2024/07/04 07:04:58.506]             The function to call. Called without arguments.
       [2024/07/04 07:04:58.506]         :param when:
       [2024/07/04 07:04:58.506]             The phase in which the function is called.
       [2024/07/04 07:04:58.506]         :param reraise:
       [2024/07/04 07:04:58.506]             Exception or exceptions that shall propagate if raised by the
       [2024/07/04 07:04:58.506]             function, instead of being wrapped in the CallInfo.
       [2024/07/04 07:04:58.506]         """
       [2024/07/04 07:04:58.506]         excinfo = None
       [2024/07/04 07:04:58.507]         start = timing.time()
       [2024/07/04 07:04:58.507]         precise_start = timing.perf_counter()
       [2024/07/04 07:04:58.507]         try:
       [2024/07/04 07:04:58.507] >           result: Optional[TResult] = func()
       [2024/07/04 07:04:58.507] .tox/test-eg/lib/pypy3.10/site-packages/_pytest/runner.py:341:
       [2024/07/04 07:04:58.507] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/07/04 07:04:58.507] .tox/test-eg/lib/pypy3.10/site-packages/_pytest/runner.py:241: in <lambda>
       [2024/07/04 07:04:58.507]     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
       [2024/07/04 07:04:58.507] .tox/test-eg/lib/pypy3.10/site-packages/pluggy/_hooks.py:513: in __call__
       [2024/07/04 07:04:58.507]     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
       [2024/07/04 07:04:58.507] .tox/test-eg/lib/pypy3.10/site-packages/pluggy/_manager.py:120: in _hookexec
       [2024/07/04 07:04:58.507]     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
       [2024/07/04 07:04:58.507] .tox/test-eg/lib/pypy3.10/site-packages/_pytest/threadexception.py:87: in pytest_runtest_call
       [2024/07/04 07:04:58.507]     yield from thread_exception_runtest_hook()
       [2024/07/04 07:04:58.507] .tox/test-eg/lib/pypy3.10/site-packages/_pytest/threadexception.py:63: in thread_exception_runtest_hook
       [2024/07/04 07:04:58.507]     yield
       [2024/07/04 07:04:58.507] .tox/test-eg/lib/pypy3.10/site-packages/_pytest/unraisableexception.py:90: in pytest_runtest_call
       [2024/07/04 07:04:58.507]     yield from unraisable_exception_runtest_hook()
       [2024/07/04 07:04:58.507] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2024/07/04 07:04:58.507]     def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
       [2024/07/04 07:04:58.507]         with catch_unraisable_exception() as cm:
       [2024/07/04 07:04:58.507]             try:
       [2024/07/04 07:04:58.507]                 yield
       [2024/07/04 07:04:58.507]             finally:
       [2024/07/04 07:04:58.507]                 if cm.unraisable:
       [2024/07/04 07:04:58.507]                     if cm.unraisable.err_msg is not None:
       [2024/07/04 07:04:58.507]                         err_msg = cm.unraisable.err_msg
       [2024/07/04 07:04:58.507]                     else:
       [2024/07/04 07:04:58.507]                         err_msg = "Exception ignored in"
       [2024/07/04 07:04:58.507]                     msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
       [2024/07/04 07:04:58.507]                     msg += "".join(
       [2024/07/04 07:04:58.507]                         traceback.format_exception(
       [2024/07/04 07:04:58.507]                             cm.unraisable.exc_type,
       [2024/07/04 07:04:58.507]                             cm.unraisable.exc_value,
       [2024/07/04 07:04:58.507]                             cm.unraisable.exc_traceback,
       [2024/07/04 07:04:58.507]                         )
       [2024/07/04 07:04:58.507]                     )
       [2024/07/04 07:04:58.507] >                   warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
       [2024/07/04 07:04:58.507] E                   pytest.PytestUnraisableExceptionWarning: Exception ignored in: finalizer of : <coroutine object AsyncClientContext._check_user_provided at 0x0000000002554848>
       [2024/07/04 07:04:58.507] E
       [2024/07/04 07:04:58.507] E                   RuntimeWarning: coroutine 'AsyncClientContext._check_user_provided' was never awaited
       [2024/07/04 07:04:58.507] .tox/test-eg/lib/pypy3.10/site-packages/_pytest/unraisableexception.py:80: PytestUnraisableExceptionWarning
       

      https://spruce.mongodb.com/task/mongo_python_driver_tests_pyopenssl__platform~rhel8_auth~auth_ssl~ssl_python_version~pypy3.10_pyopenssl~enabled_test_3.6_replica_set_f5b102ab2a496f5b5e8acce1bcd8bf27f721a075_24_07_03_00_03_10/logs?execution=0&sortBy=STATUS&sortDir=ASC

      Caused by PYTHON-4520.

            Assignee:
            shane.harvey@mongodb.com Shane Harvey
            Reporter:
            shane.harvey@mongodb.com Shane Harvey
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: