box/flaky

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

dimaqq opened this issue · 8 comments

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

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

@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

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

@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?

pytest-asyncio 0.17 has just been released.

I guess to close the issue.

arg0d commented

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.

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.