box / box/flaky

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

Open
#166 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
398
Forks
57
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Research direction

Start with the minimal reproducible example at https://github.com/dimaqq/mre-loop-closed and compare its behavior with the cross-posted pytest-asyncio issue. Reproduce the interaction among pytest, pytest-asyncio, and flaky; done means a failed flaky test is reported as a failure and retried instead of breaking with a closed event loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.