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

Open
#166 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

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.

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

Dominant language
Python
Stars
397
Forks
57
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from box/flaky

All issues in box/flaky

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.