bokeh icon indicating copy to clipboard operation
bokeh copied to clipboard

CI unit-test on Python 3.9 fails systematically

Open mattpap opened this issue 2 years ago • 2 comments

Noticed on multiple recent PRs, e.g. https://github.com/bokeh/bokeh/actions/runs/6759027374/job/18371768064?pr=13512:

=================================== FAILURES ===================================
___________________ test__autocreate_signed_session_autoload ___________________

cls = <class '_pytest.runner.CallInfo'>
func = <function call_runtest_hook.<locals>.<lambda> at 0x7fc4ed3c35e0>
when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)

    @classmethod
    def from_call(
        cls,
        func: "Callable[[], TResult]",
        when: "Literal['collect', 'setup', 'call', 'teardown']",
        reraise: Optional[
            Union[Type[BaseException], Tuple[Type[BaseException], ...]]
        ] = None,
    ) -> "CallInfo[TResult]":
        """Call func, wrapping the result in a CallInfo.
    
        :param func:
            The function to call. Called without arguments.
        :param when:
            The phase in which the function is called.
        :param reraise:
            Exception or exceptions that shall propagate if raised by the
            function, instead of being wrapped in the CallInfo.
        """
        excinfo = None
        start = timing.time()
        precise_start = timing.perf_counter()
        try:
>           result: Optional[TResult] = func()

/usr/share/miniconda3/envs/bk-test/lib/python3.9/site-packages/_pytest/runner.py:341: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/usr/share/miniconda3/envs/bk-test/lib/python3.9/site-packages/_pytest/runner.py:262: in <lambda>
    lambda: ihook(item=item, **kwds), when=when, reraise=reraise
/usr/share/miniconda3/envs/bk-test/lib/python3.9/site-packages/pluggy/_hooks.py:493: in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
/usr/share/miniconda3/envs/bk-test/lib/python3.9/site-packages/pluggy/_manager.py:115: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
/usr/share/miniconda3/envs/bk-test/lib/python3.9/site-packages/_pytest/unraisableexception.py:88: in pytest_runtest_call
    yield from unraisable_exception_runtest_hook()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

    def unraisable_exception_runtest_hook() -> Generator[None, None, None]:
        with catch_unraisable_exception() as cm:
            yield
            if cm.unraisable:
                if cm.unraisable.err_msg is not None:
                    err_msg = cm.unraisable.err_msg
                else:
                    err_msg = "Exception ignored in"
                msg = f"{err_msg}: {cm.unraisable.object!r}\n\n"
                msg += "".join(
                    traceback.format_exception(
                        cm.unraisable.exc_type,
                        cm.unraisable.exc_value,
                        cm.unraisable.exc_traceback,
                    )
                )
>               warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
E               pytest.PytestUnraisableExceptionWarning: Exception ignored in: <coroutine object HTTPServer.close_all_connections at 0x7fc4ec[444](https://github.com/bokeh/bokeh/actions/runs/6759027374/job/18371768064?pr=13512#step:8:445)c40>
E               
E               Traceback (most recent call last):
E                 File "/usr/share/miniconda3/envs/bk-test/lib/python3.9/asyncio/selector_events.py", line 293, in _add_writer
E                   key = self._selector.get_key(fd)
E                 File "/usr/share/miniconda3/envs/bk-test/lib/python3.9/selectors.py", line 193, in get_key
E                   raise KeyError("{!r} is not registered".format(fileobj)) from None
E               KeyError: '77 is not registered'
E               
E               During handling of the above exception, another exception occurred:
E               
E               Traceback (most recent call last):
E                 File "<string>", line 1, in <lambda>
E               KeyError: '__import__'

/usr/share/miniconda3/envs/bk-test/lib/python3.9/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning

mattpap avatar Nov 05 '23 20:11 mattpap

Can I work on this issue? Please tell me how to reproduce it

SarthakNikhal avatar Nov 16 '23 05:11 SarthakNikhal

Apparently this doesn't fail anymore (at least not systematically) in recent PRs. I also previously noticed this on occasion in CI with other Python versions.

mattpap avatar Nov 17 '23 19:11 mattpap