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

flaky + pytest-asyncio: RuntimeError: Event loop is closed #166

Open
dimaqq opened this issue Jul 29, 2020 · 8 comments
Open

flaky + pytest-asyncio: RuntimeError: Event loop is closed #166

dimaqq opened this issue Jul 29, 2020 · 8 comments

Comments

@dimaqq
Copy link

dimaqq commented Jul 29, 2020

Latest pytest, pytest-asyncio and flaky just can't live happily together.

When a flaky test fails, an error RuntimeError: Event loop is closed is reported instead of failure.
Edit: In fact, first test failure breaks the harness and "flaky" test is not retried.

MRE: https://github.com/dimaqq/mre-loop-closed

Edit: cross-posted to pytest-dev/pytest-asyncio#178

@heliping
Copy link

any updates? need to use flaky with pyppeteer to test web UI.

@seifertm
Copy link

seifertm commented Jan 7, 2022

@dimaqq @heliping The issue was addressed in pytest-asyncio. Can you check if the fix works for you? You'll need to install the VCS version of pytest-asyncio for that:
pip install pytest-asyncio@git+https://github.com/pytest-dev/pytest-asyncio.git@master

@jaredar1232
Copy link

@seifertm awesome, this appears to have fixed this issue for me. Any idea when it will be in a stable release?

@seifertm
Copy link

@jaredar1232 I think a release in the near future would make sense, especially because of the deprecations around async fixture handling.

@Tinche @asvetlov Would it make sense to release pytest-asyncio v0.17? Or is there something that needs to be done before that?

@seifertm
Copy link

See pytest-dev/pytest-asyncio#248

@asvetlov
Copy link

pytest-asyncio 0.17 has just been released.

I guess to close the issue.

@arg0d
Copy link

arg0d commented Apr 22, 2022

I can confirm this is fixed when using pytest-asyncio ~= 0.18. Previously I was using pytest-asyncio ~= 0.16 and had the same error as described in this issue.

@seifertm
Copy link

This issue seems to have been fixed. A user reported a working integration between flaky and pytest-asyncio for v0.18.

I suppose it would be reasonable to close this issue.

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

Successfully merging a pull request may close this issue.

6 participants