GoogleChromeLabs / chromium-bidi

Implementation of WebDriver BiDi for Chromium
https://googlechromelabs.github.io/chromium-bidi/
Apache License 2.0
85 stars 28 forks source link

Flaky subscription test #1717

Open OrKoN opened 5 months ago

OrKoN commented 5 months ago

Example failure ERROR tests/session/test_subscription.py::test_subscribeToNestedContext_subscribesToTopLevelContext[websocket0] - Failed: Timeout >10.0s

https://github.com/GoogleChromeLabs/chromium-bidi/actions/runs/7570581376/job/20616238200?pr=1716

cc @sadym-chromium

sadym-chromium commented 4 months ago

Log: 2024-01-18T13-20-00.261Z.log Output:


==================================== ERRORS ====================================
_ ERROR at setup of test_subscribeToNestedContext_subscribesToTopLevelContext[websocket0] _

event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
request = <SubRequest 'websocket' for <Function test_subscribeToNestedContext_subscribesToTopLevelContext[websocket0]>>
kwargs = {'_websocket_connection': <websockets.legacy.client.WebSocketClientProtocol object at 0x108daf3d0>}
setup = <function _wrap_async_fixture.<locals>._async_fixture_wrapper.<locals>.setup at 0x108db7ba0>

    @functools.wraps(fixture)
    def _async_fixture_wrapper(
--- Logging error ---
        event_loop: asyncio.AbstractEventLoop, request: SubRequest, **kwargs: Any
    ):
        func = _perhaps_rebind_fixture_func(
            fixture, request.instance, fixturedef.unittest
Traceback (most recent call last):
        )
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/logging/__init__.py", line 1113, in emit

    stream.write(msg + self.terminator)
        async def setup():
            res = await func(**_add_kwargs(func, kwargs, event_loop, request))
            return res

>       return event_loop.run_until_complete(setup())

../../../.local/share/virtualenvs/chromium-bidi-gOoBNvmZ/lib/python3.11/site-packages/pytest_asyncio/plugin.py:326: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py:640: in run_until_complete
    self.run_forever()
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py:607: in run_forever
    self._run_once()
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py:1884: in _run_once
    event_list = self._selector.select(timeout)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <selectors.KqueueSelector object at 0x108da2d90>
timeout = 19.999104173999967

    def select(self, timeout=None):
        timeout = None if timeout is None else max(timeout, 0)
        # If max_ev is 0, kqueue will ignore the timeout. For consistent
        # behavior with the other selector classes, we prevent that here
        # (using max). See https://bugs.python.org/issue29255
        max_ev = self._max_events or 1
        ready = []
        try:
>           kev_list = self._selector.control(None, max_ev, timeout)
ValueError: I/O operation on closed file.
E           Failed: Timeout >10.0s
Call stack:

  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1797, in call_exception_handler
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/selectors.py:566: Failed
    self.default_exception_handler(context)
---------------------------- Captured stderr setup -----------------------------
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 1771, in default_exception_handler
INFO:test_helpers:Executing command with method 'session.new' and params '{'capabilities': {'alwaysMatch': {}}}'...
    logger.error('\n'.join(log_lines), exc_info=exc_info)

Message: "Task exception was never retrieved\nfuture: <Task finished name='Task-2269' coro=<_wrap_async_fixture.<locals>._async_fixture_wrapper.<locals>.setup() done, defined at /Users/runner/.local/share/virtualenvs/chromium-bidi-gOoBNvmZ/lib/python3.11/site-packages/pytest_asyncio/plugin.py:322> exception=ConnectionClosedOK(Close(code=1000, reason=''), Close(code=1000, reason=''), False)>"
+++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++
Arguments: ()

~~~~~~~~~~~~~~~~~~~~~ Stack of asyncio_0 (123145505280000) ~~~~~~~~~~~~~~~~~~~~~
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1002, in _bootstrap
    self._bootstrap_inner()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/concurrent/futures/thread.py", line 81, in _worker
    work_item = work_queue.get(block=True)

~~~~~~~~~~~~~ Stack of Thread-2 (thread_target) (123145488490496) ~~~~~~~~~~~~~~
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1002, in _bootstrap
    self._bootstrap_inner()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/runner/.local/share/virtualenvs/chromium-bidi-gOoBNvmZ/lib/python3.11/site-packages/pytest_httpserver/httpserver.py", line 710, in thread_target
    self.server.serve_forever()
  File "/Users/runner/.local/share/virtualenvs/chromium-bidi-gOoBNvmZ/lib/python3.11/site-packages/werkzeug/serving.py", line 806, in serve_forever
    super().serve_forever(poll_interval=poll_interval)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socketserver.py", line 233, in serve_forever
    ready = selector.select(poll_interval)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/selectors.py", line 428, in select
    return ready

~~~~~~~~~~~~~ Stack of Thread-1 (thread_target) (123145471700992) ~~~~~~~~~~~~~~
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1002, in _bootstrap
    self._bootstrap_inner()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/runner/.local/share/virtualenvs/chromium-bidi-gOoBNvmZ/lib/python3.11/site-packages/pytest_httpserver/httpserver.py", line 710, in thread_target
    self.server.serve_forever()
  File "/Users/runner/.local/share/virtualenvs/chromium-bidi-gOoBNvmZ/lib/python3.11/site-packages/werkzeug/serving.py", line 806, in serve_forever
    super().serve_forever(poll_interval=poll_interval)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socketserver.py", line 233, in serve_forever
    ready = selector.select(poll_interval)
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/selectors.py", line 428, in select
    return ready

+++++++++++++++++++++++++++++++++++ Timeout ++++++++++++++++++++++++++++++++++++
------------------------------ Captured log setup ------------------------------
INFO     test_helpers:test_helpers.py:80 Executing command with method 'session.new' and params '{'capabilities': {'alwaysMatch': {}}}'...
--------------------------- snapshot report summary ----------------------------
2 snapshots passed.
=========================== short test summary info ============================
ERROR tests/session/test_subscription.py::test_subscribeToNestedContext_subscribesToTopLevelContext[websocket0] - Failed: Timeout >10.0s