Skip to content

fix(tests): use asyncio.run in integration reachability fixtures - #160

Merged
officialCodeWork merged 1 commit into
mainfrom
fix/integration-conftest-asyncio-run
Jun 8, 2026
Merged

fix(tests): use asyncio.run in integration reachability fixtures#160
officialCodeWork merged 1 commit into
mainfrom
fix/integration-conftest-asyncio-run

Conversation

@officialCodeWork

Copy link
Copy Markdown
Owner

Summary

The integration reachability fixtures in tests/integration/conftest.py used asyncio.get_event_loop().run_until_complete(...), which raises RuntimeError: There is no current event loop in thread 'MainThread' under Python 3.12 + the current pytest-asyncio. As a result, a full-suite run (pytest tests packages apps/gateway) errored at collection of tests/integration/test_pg_corpus_store.py instead of skipping when the Docker backends aren't up.

Switched each probe (pg / redis / qdrant / minio / weaviate / elasticsearch) to asyncio.run(...), which manages its own event loop, so the fixtures pytest.skip cleanly when a backend is unreachable.

Test plan

  • uv run pytest tests/integration -q with no Docker backends → all integration tests skip (previously errored at setup)
  • ruff check tests/integration/conftest.py

🤖 Generated with Claude Code

`asyncio.get_event_loop()` raises `RuntimeError: There is no current
event loop` under Python 3.12, so the integration reachability fixtures
(pg / redis / qdrant / minio / weaviate / elasticsearch) errored at setup
instead of skipping when the Docker backends aren't running — breaking a
full-suite run (`pytest tests packages apps/gateway`) at collection.

Switch each probe to `asyncio.run(...)`, which manages its own loop, so
the fixtures skip cleanly when a backend is unreachable.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@officialCodeWork
officialCodeWork merged commit 722ab74 into main Jun 8, 2026
12 of 17 checks passed
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 this pull request may close these issues.

1 participant