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

pytest-asyncio 0.25.1 breaks our Playwright tests #1902

Open
manics opened this issue Jan 6, 2025 · 0 comments
Open

pytest-asyncio 0.25.1 breaks our Playwright tests #1902

manics opened this issue Jan 6, 2025 · 0 comments
Labels

Comments

@manics
Copy link
Member

manics commented Jan 6, 2025

Bug description

pytest-asyncio 0.25.1 was released on Jan 2, 2025, and it's broken our Playwright tests on GitHub CI.

Pinning to less that 0.25.1 allows the tests to pass:

How to reproduce

See recent runs of https://github.com/jupyterhub/binderhub/actions/workflows/playwright.yaml

==================================== ERRORS ====================================
_ ERROR at teardown of test_loading_page[firefox-gh-binderhub-ci-repos/requirements-master---200] _

request = <SubRequest 'event_loop' for <Coroutine test_loading_page[firefox-gh-binderhub-ci-repos/requirements-master---200]>>

    @pytest.fixture
    def event_loop(request: FixtureRequest) -> Iterator[asyncio.AbstractEventLoop]:
        """Create an instance of the default event loop for each test case."""
        new_loop_policy = request.getfixturevalue(event_loop_policy.__name__)
>       with _temporary_event_loop_policy(new_loop_policy):

/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/pytest_asyncio/plugin.py:1150: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/contextlib.py:144: in __exit__
    next(self.gen)
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/site-packages/pytest_asyncio/plugin.py:775: in _temporary_event_loop_policy
    current_loop.close()
/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/asyncio/unix_events.py:68: in close
    super().close()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <_UnixSelectorEventLoop running=True closed=False debug=False>

    def close(self):
        if self.is_running():
>           raise RuntimeError("Cannot close a running event loop")
E           RuntimeError: Cannot close a running event loop

/opt/hostedtoolcache/Python/3.12.8/x64/lib/python3.12/asyncio/selector_events.py:101: RuntimeError

Related issue: #1894

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant