Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures with trio >= 0.25.0 #187

Open
mgorny opened this issue Mar 26, 2024 · 5 comments
Open

Test failures with trio >= 0.25.0 #187

mgorny opened this issue Mar 26, 2024 · 5 comments

Comments

@mgorny
Copy link

mgorny commented Mar 26, 2024

After upgrading to trio >= 0.25.0, the exception-related tests start failing:

python -m pytest --cov=trio_websocket --no-cov-on-fail
============================= test session starts ==============================
platform linux -- Python 3.11.8, pytest-8.1.1, pluggy-1.4.0
rootdir: /tmp/trio-websocket
configfile: pytest.ini
plugins: trio-0.8.0, cov-5.0.0
collected 58 items

tests/test_connection.py .........................FFF...........FFF..... [ 81%]
.........F.                                                              [100%]

=================================== FAILURES ===================================
____________________ test_handshake_exception_before_accept ____________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 432, in test_handshake_exception_before_accept
    |     async with trio.open_nursery() as nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Exception Group Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 432, in serve_websocket
      |     await server.run(task_status=task_status)
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1408, in run
      |     async with trio.open_nursery() as nursery:
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
      |     raise combined_error_from_nursery
      | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
      +-+---------------- 1 ----------------
        | Exception Group Traceback (most recent call last):
        |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_highlevel_serve_listeners.py", line 135, in serve_listeners
        |     async with trio.open_nursery() as nursery:
        |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
        |     raise combined_error_from_nursery
        | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
        +-+---------------- 1 ----------------
          | Exception Group Traceback (most recent call last):
          |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_highlevel_serve_listeners.py", line 33, in _run_handler
          |     await handler(stream)
          |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1426, in _handle_connection
          |     async with trio.open_nursery() as nursery:
          |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
          |     raise combined_error_from_nursery
          | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
          +-+---------------- 1 ----------------
            | Traceback (most recent call last):
            |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1439, in _handle_connection
            |     await self._handler(request)
            |   File "/tmp/trio-websocket/tests/test_connection.py", line 429, in handler
            |     raise ValueError()
            | ValueError
            +------------------------------------
____________________________ test_reject_handshake _____________________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 448, in test_reject_handshake
    |     async with open_websocket(HOST, server.port, RESOURCE, use_ssl=False,
    |   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1225, in _reader_task
      |     await handler(event)
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1100, in _handle_reject_data_event
      |     raise ConnectionRejected(self._reject_status, self._reject_headers,
      | trio_websocket._impl.ConnectionRejected
      +------------------------------------
__________________ test_reject_handshake_invalid_info_status ___________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 470, in test_reject_handshake_invalid_info_status
    |     async with open_websocket(HOST, port, RESOURCE, use_ssl=False,
    |   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1225, in _reader_task
      |     await handler(event)
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 1089, in _handle_reject_connection_event
      |     raise ConnectionRejected(self._reject_status, self._reject_headers,
      | trio_websocket._impl.ConnectionRejected
      +------------------------------------
___________________________ test_client_open_timeout ___________________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 614, in test_client_open_timeout
    |     async with open_websocket(HOST, server.port, '/', use_ssl=False,
    |   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 126, in open_websocket
      |     raise ConnectionTimeout from None
      | trio_websocket._impl.ConnectionTimeout
      +------------------------------------
__________________________ test_client_close_timeout ___________________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 123, in wrapper
    |     await fn(*args, **kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 642, in test_client_close_timeout
    |     async with open_websocket(HOST, server.port, RESOURCE, use_ssl=False,
    |   File "/usr/lib/python3.11/contextlib.py", line 217, in __aexit__
    |     await anext(self.gen)
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 136, in open_websocket
      |     raise DisconnectionTimeout from None
      | trio_websocket._impl.DisconnectionTimeout
      +------------------------------------
_____________________ test_client_connect_networking_error _____________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 652, in test_client_connect_networking_error
    |     async with open_websocket(HOST, 0, '/', use_ssl=False) as client_ws:
    |   File "/usr/lib/python3.11/contextlib.py", line 210, in __aenter__
    |     return await anext(self.gen)
    |            ^^^^^^^^^^^^^^^^^^^^^
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 120, in open_websocket
      |     connection = await connect_websocket(new_nursery, host, port,
      |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/usr/lib/python3.11/unittest/mock.py", line 2237, in _execute_mock_call
      |     raise effect
      | OSError
      | 
      | The above exception was the direct cause of the following exception:
      | 
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 128, in open_websocket
      |     raise HandshakeError from e
      | trio_websocket._impl.HandshakeError
      +------------------------------------
_____________________ test_finalization_dropped_exception ______________________
  + Exception Group Traceback (most recent call last):
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 340, in from_call
  |     result: Optional[TResult] = func()
  |                                 ^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 240, in <lambda>
  |     lambda: runtest_hook(item=item, **kwds), when=when, reraise=reraise
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 181, in _multicall
  |     return outcome.get_result()
  |            ^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_result.py", line 99, in get_result
  |     raise exc.with_traceback(exc.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 87, in pytest_runtest_call
  |     yield from thread_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/threadexception.py", line 63, in thread_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 90, in pytest_runtest_call
  |     yield from unraisable_exception_runtest_hook()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/unraisableexception.py", line 65, in unraisable_exception_runtest_hook
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 849, in pytest_runtest_call
  |     yield from self._runtest_for(item, "call")
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/logging.py", line 832, in _runtest_for
  |     yield
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/capture.py", line 883, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 166, in _multicall
  |     teardown.throw(outcome._exception)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/skipping.py", line 256, in pytest_runtest_call
  |     return (yield)
  |             ^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 182, in pytest_runtest_call
  |     raise e
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/runner.py", line 172, in pytest_runtest_call
  |     item.runtest()
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 1772, in runtest
  |     self.ihook.pytest_pyfunc_call(pyfuncitem=self)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_hooks.py", line 501, in __call__
  |     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_manager.py", line 119, in _hookexec
  |     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 138, in _multicall
  |     raise exception.with_traceback(exception.__traceback__)
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pluggy/_callers.py", line 102, in _multicall
  |     res = hook_impl.function(*args)
  |           ^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/_pytest/python.py", line 195, in pytest_pyfunc_call
  |     result = testfunction(**testargs)
  |              ^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 348, in wrapper
  |     return run(partial(fn, **kwargs), clock=clock, instruments=instruments)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 2288, in run
  |     raise runner.main_task_outcome.error
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 426, in _bootstrap_fixtures_and_run_test
  |     raise test_ctx.error_list[0]
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 193, in _fixture_manager
  |     async with trio.open_nursery() as nursery_fixture:
  |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
  |     raise combined_error_from_nursery
  | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 195, in _fixture_manager
    |     yield nursery_fixture
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/pytest_trio/plugin.py", line 250, in run
    |     await self._func(**resolved_kwargs)
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 1014, in test_finalization_dropped_exception
    |     with trio.move_on_after(1):
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 643, in __exit__
    |     raise remaining_error_after_cancel_scope
    |   File "/tmp/trio-websocket/tests/test_connection.py", line 1015, in test_finalization_dropped_exception
    |     async with open_websocket(HOST, echo_server.port, RESOURCE, use_ssl=False):
    |   File "/usr/lib/python3.11/contextlib.py", line 231, in __aexit__
    |     await self.gen.athrow(typ, value, traceback)
    |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 117, in open_websocket
    |     async with trio.open_nursery() as new_nursery:
    |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 954, in __aexit__
    |     raise combined_error_from_nursery
    | ExceptionGroup: Exceptions from Trio nursery (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/tests/test_connection.py", line 1017, in test_finalization_dropped_exception
      |     await trio.sleep_forever()
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_timeouts.py", line 48, in sleep_forever
      |     await trio.lowlevel.wait_task_rescheduled(lambda _: trio.lowlevel.Abort.SUCCEEDED)
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_traps.py", line 179, in wait_task_rescheduled
      |     return (await _async_yield(WaitTaskRescheduled(abort_func))).unwrap()
      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/outcome/_impl.py", line 213, in unwrap
      |     raise captured_error
      |   File "/tmp/trio-websocket/.venv/lib/python3.11/site-packages/trio/_core/_run.py", line 1441, in raise_cancel
      |     raise Cancelled._create()
      | trio.Cancelled: Cancelled
      | 
      | During handling of the above exception, another exception occurred:
      | 
      | Traceback (most recent call last):
      |   File "/tmp/trio-websocket/trio_websocket/_impl.py", line 130, in open_websocket
      |     yield connection
      |   File "/tmp/trio-websocket/tests/test_connection.py", line 1019, in test_finalization_dropped_exception
      |     raise ValueError
      | ValueError
      +------------------------------------
=========================== short test summary info ============================
FAILED tests/test_connection.py::test_handshake_exception_before_accept - Exc...
FAILED tests/test_connection.py::test_reject_handshake - ExceptionGroup: Exce...
FAILED tests/test_connection.py::test_reject_handshake_invalid_info_status - ...
FAILED tests/test_connection.py::test_client_open_timeout - ExceptionGroup: E...
FAILED tests/test_connection.py::test_client_close_timeout - ExceptionGroup: ...
FAILED tests/test_connection.py::test_client_connect_networking_error - Excep...
FAILED tests/test_connection.py::test_finalization_dropped_exception - Except...
========================= 7 failed, 51 passed in 0.71s =========================
make: *** [Makefile:11: test] Error 1
@belm0
Copy link
Member

belm0 commented Mar 27, 2024

It's due to the strict_exception_groups=True default.

I'm not sure what to do, because strict_exception_groups=True code is not really compatible with strict_exception_groups=False code (nor with code using trio versions predating the strict_exception_groups option, which trio-websocket still supports).

Sure I can set strict_exception_groups=False on the tests, and they'll pass. But that doesn't mean that trio-websocket will work correctly under strict_exception_groups=True. All except statements in the codebase need to be reviewed to make sure there wouldn't be an ExceptionGroup in some cases where there wasn't previously.

@mgorny
Copy link
Author

mgorny commented Mar 27, 2024

I'm sorry but I don't really know trio to advise much but from what you're saying, I think you could duplicate tests to test with and without strict_exception_groups.

@belm0
Copy link
Member

belm0 commented Mar 27, 2024

summary: trio-websocket is not "safe" to use with strict_exception_groups=True. It will require manual review of the code and manual testing, as well as migration to exception groups.

@belm0
Copy link
Member

belm0 commented Mar 28, 2024

This is really about trio-websocket's support for trio nurseries always raising ExceptionGroup. The only reasonable way for packages and applications to deal with that is by using the new exception catching mechanism of except*, the exceptiongroup backport, or otherwise ensuring that concurrent exceptions converge to a single winner locally.

The intention of the trio-websocket API has always been to avoid leaking concurrent exceptions (MultiError/ExceptionGroup, see #132). The most important thing is to preserve this behavior in the face of strict_exception_groups=True.

Managing this for the trio-websocket project might look like:

  1. add a strict_exception_groups != True assertion to the library - It makes in clear that the current code only supports trio with the old raising behavior (not wrapped in ExceptionGroup if there is a single exception). This means trio < 0.25 with the strict_exception_groups=False default or trio >= 0.25 with run(strict_exception_groups=False). The version of trio that eventually removes the strict_exception_groups option will not be supported.
  2. make changes to support strict_exception_groups=True - Development work is needed to review all exception catching (except:) within an async context, as well as every exception potentially raised by async functions or context managers in the API, and make appropriate changes. Unknown how long it will take. Depending on how the exception catching/filtering is implemented, this revision might naturally support strict_exception_groups=False too.

@kloczek
Copy link

kloczek commented Apr 5, 2024

I just hit the same issue 🤔

algitbot pushed a commit to alpinelinux/aports that referenced this issue Apr 12, 2024
py3-trio-websocket stopped working with py3-trio>=0.25.

This broke the testsuite for streamlink.

Delete til it is fixed upstream so we don't ship a broken package.

ref: python-trio/trio-websocket#187
algitbot pushed a commit to alpinelinux/aports that referenced this issue Apr 12, 2024
algitbot pushed a commit to alpinelinux/aports that referenced this issue Apr 12, 2024
Exception related tests fails with trio 0.25.0. Disable those til it is
resolved upstream.

ref: python-trio/trio-websocket#187
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants