flaky icon indicating copy to clipboard operation
flaky copied to clipboard

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

Open dimaqq opened this issue 3 years ago • 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 https://github.com/pytest-dev/pytest-asyncio/issues/178

dimaqq avatar Jul 29 '20 00:07 dimaqq

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

heliping avatar Aug 16 '21 06:08 heliping

@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 avatar Jan 07 '22 07:01 seifertm

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

jaredar1232 avatar Jan 10 '22 22:01 jaredar1232

@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 avatar Jan 11 '22 13:01 seifertm

See https://github.com/pytest-dev/pytest-asyncio/issues/248

seifertm avatar Jan 11 '22 14:01 seifertm

pytest-asyncio 0.17 has just been released.

I guess to close the issue.

asvetlov avatar Jan 13 '22 12:01 asvetlov

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.

arg0d avatar Apr 22 '22 08:04 arg0d

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.

seifertm avatar Nov 15 '23 15:11 seifertm