Uploaded image for project: 'Motor'
  1. Motor
  2. MOTOR-1216

Test Failure - ChangeStream test_concurrent_close fails on synchro 3.12

    • Type: Icon: Build Failure Build Failure
    • Resolution: Fixed
    • Priority: Icon: Unknown Unknown
    • 3.3.2
    • Affects Version/s: None
    • Component/s: None
    • None

      ChangeStream test_concurrent_close fails on synchro Python 3.12. Note that it passes on Python 3.7:

       [2023/11/09 18:41:38.494] ________________ TestDatabaseChangeStream.test_concurrent_close ________________
       [2023/11/09 18:41:38.494] cls = <class '_pytest.runner.CallInfo'>
       [2023/11/09 18:41:38.494] func = <function call_runtest_hook.<locals>.<lambda> at 0x7fb8f105d300>
       [2023/11/09 18:41:38.494] when = 'call'
       [2023/11/09 18:41:38.494] reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
       [2023/11/09 18:41:38.494]     @classmethod
       [2023/11/09 18:41:38.494]     def from_call(
       [2023/11/09 18:41:38.494]         cls,
       [2023/11/09 18:41:38.494]         func: "Callable[[], TResult]",
       [2023/11/09 18:41:38.494]         when: "Literal['collect', 'setup', 'call', 'teardown']",
       [2023/11/09 18:41:38.494]         reraise: Optional[
       [2023/11/09 18:41:38.494]             Union[Type[BaseException], Tuple[Type[BaseException], ...]]
       [2023/11/09 18:41:38.494]         ] = None,
       [2023/11/09 18:41:38.494]     ) -> "CallInfo[TResult]":
       [2023/11/09 18:41:38.494]         """Call func, wrapping the result in a CallInfo.
       [2023/11/09 18:41:38.494]         :param func:
       [2023/11/09 18:41:38.494]             The function to call. Called without arguments.
       [2023/11/09 18:41:38.494]         :param when:
       [2023/11/09 18:41:38.494]             The phase in which the function is called.
       [2023/11/09 18:41:38.494]         :param reraise:
       [2023/11/09 18:41:38.494]             Exception or exceptions that shall propagate if raised by the
       [2023/11/09 18:41:38.494]             function, instead of being wrapped in the CallInfo.
       [2023/11/09 18:41:38.494]         """
       [2023/11/09 18:41:38.494]         excinfo = None
       [2023/11/09 18:41:38.494]         start = timing.time()
       [2023/11/09 18:41:38.494]         precise_start = timing.perf_counter()
       [2023/11/09 18:41:38.494]         try:
       [2023/11/09 18:41:38.494] >           result: Optional[TResult] = func()
       [2023/11/09 18:41:38.494] ../../lib/python3.12/site-packages/_pytest/runner.py:341:
       [2023/11/09 18:41:38.494] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2023/11/09 18:41:38.494] ../../lib/python3.12/site-packages/_pytest/runner.py:262: in <lambda>
       [2023/11/09 18:41:38.494]     lambda: ihook(item=item, **kwds), when=when, reraise=reraise
       [2023/11/09 18:41:38.494] ../../lib/python3.12/site-packages/pluggy/_hooks.py:493: in __call__
       [2023/11/09 18:41:38.494]     return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
       [2023/11/09 18:41:38.494] ../../lib/python3.12/site-packages/pluggy/_manager.py:115: in _hookexec
       [2023/11/09 18:41:38.494]     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
       [2023/11/09 18:41:38.494] ../../lib/python3.12/site-packages/_pytest/threadexception.py:83: in pytest_runtest_call
       [2023/11/09 18:41:38.494]     yield from thread_exception_runtest_hook()
       [2023/11/09 18:41:38.494] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
       [2023/11/09 18:41:38.494]     def thread_exception_runtest_hook() -> Generator[None, None, None]:
       [2023/11/09 18:41:38.494]         with catch_threading_exception() as cm:
       [2023/11/09 18:41:38.494]             yield
       [2023/11/09 18:41:38.494]             if cm.args:
       [2023/11/09 18:41:38.494]                 thread_name = "<unknown>" if cm.args.thread is None else cm.args.thread.name
       [2023/11/09 18:41:38.494]                 msg = f"Exception in thread {thread_name}\n\n"
       [2023/11/09 18:41:38.494]                 msg += "".join(
       [2023/11/09 18:41:38.494]                     traceback.format_exception(
       [2023/11/09 18:41:38.494]                         cm.args.exc_type,
       [2023/11/09 18:41:38.494]                         cm.args.exc_value,
       [2023/11/09 18:41:38.494]                         cm.args.exc_traceback,
       [2023/11/09 18:41:38.494]                     )
       [2023/11/09 18:41:38.494]                 )
       [2023/11/09 18:41:38.494] >               warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
       [2023/11/09 18:41:38.497] E               pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-5 (iterate_cursor)
       [2023/11/09 18:41:38.497] E
       [2023/11/09 18:41:38.497] E               Traceback (most recent call last):
       [2023/11/09 18:41:38.497] E                 File "/opt/python/3.12/lib/python3.12/threading.py", line 1052, in _bootstrap_inner
       [2023/11/09 18:41:38.497] E                   self.run()
       [2023/11/09 18:41:38.497] E                 File "/opt/python/3.12/lib/python3.12/threading.py", line 989, in run
       [2023/11/09 18:41:38.497] E                   self._target(*self._args, **self._kwargs)
       [2023/11/09 18:41:38.497] E                 File "/data/mci/f92239d227dc7e106c0a2287be2e4936/src/.tox/synchro/tmp/mongo-python-driver/test/test_change_stream.py", line 333, in iterate_cursor
       [2023/11/09 18:41:38.497] E                   for _ in change_stream:
       [2023/11/09 18:41:38.497] E                 File "/data/mci/f92239d227dc7e106c0a2287be2e4936/src/synchro/__init__.py", line 538, in next
       [2023/11/09 18:41:38.497] E                   return self._next()
       [2023/11/09 18:41:38.497] E                          ^^^^^^^^^^^^
       [2023/11/09 18:41:38.497] E                 File "/data/mci/f92239d227dc7e106c0a2287be2e4936/src/synchro/__init__.py", line 141, in _wrap_synchro
       [2023/11/09 18:41:38.497] E                   motor_obj = fn(*args, **kwargs)
       [2023/11/09 18:41:38.497] E                               ^^^^^^^^^^^^^^^^^^^
       [2023/11/09 18:41:38.497] E                 File "/data/mci/f92239d227dc7e106c0a2287be2e4936/src/synchro/__init__.py", line 199, in _unwrap_synchro
       [2023/11/09 18:41:38.497] E                   return fn(*args, **kwargs)
       [2023/11/09 18:41:38.497] E                          ^^^^^^^^^^^^^^^^^^^
       [2023/11/09 18:41:38.497] E                 File "/data/mci/f92239d227dc7e106c0a2287be2e4936/src/synchro/__init__.py", line 344, in synchronized_method
       [2023/11/09 18:41:38.497] E                   return loop.run_sync(partial)
       [2023/11/09 18:41:38.497] E                          ^^^^^^^^^^^^^^^^^^^^^^
       [2023/11/09 18:41:38.497] E                 File "/data/mci/f92239d227dc7e106c0a2287be2e4936/src/.tox/synchro/lib/python3.12/site-packages/tornado/ioloop.py", line 527, in run_sync
       [2023/11/09 18:41:38.497] E                   return future_cell[0].result()
       [2023/11/09 18:41:38.497] E                          ^^^^^^^^^^^^^^^^^^^^^^^
       [2023/11/09 18:41:38.497] E                 File "/data/mci/f92239d227dc7e106c0a2287be2e4936/src/motor/core.py", line 2017, in next
       [2023/11/09 18:41:38.497] E                   doc = await self.try_next()
       [2023/11/09 18:41:38.497] E                         ^^^^^^^^^^^^^^^^^^^^^
       [2023/11/09 18:41:38.497] E                 File "/data/mci/f92239d227dc7e106c0a2287be2e4936/src/motor/core.py", line 2058, in try_next
       [2023/11/09 18:41:38.497] E                   return await self._framework.run_on_executor(loop, self._try_next)
       [2023/11/09 18:41:38.497] E                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       [2023/11/09 18:41:38.497] E               RuntimeError: Task <Task pending name='Task-73' coro=<AgnosticChangeStream.next() running at /data/mci/f92239d227dc7e106c0a2287be2e4936/src/motor/core.py:2017> cb=[IOLoop.add_future.<locals>.<lambda>() at /data/mci/f92239d227dc7e106c0a2287be2e4936/src/.tox/synchro/lib/python3.12/site-packages/tornado/ioloop.py:685]> got Future <Future pending cb=[_chain_future.<locals>._call_check_cancel() at /opt/python/3.12/lib/python3.12/asyncio/futures.py:387]> attached to a different loop
       [2023/11/09 18:41:38.497] ../../lib/python3.12/site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning
      

      https://evergreen.mongodb.com/task/motor_main__ssl~nossl_tox_env~synchro_py312_os~rhel84_test_rapid_sharded_cluster_546f7540f18cca2e6a2da3a55c35c64c7ce2ef62_23_11_10_02_13_27

            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: