Skip to content

Commit 19dece9

Browse files
committed
fix: failing tests
1 parent 82c7b9b commit 19dece9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

python/tests/integration/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,14 @@ async def test_db_pool(postgres_container):
165165
"""Asyncpg pool connected to the ephemeral Postgres.
166166
167167
Creates schema directly to avoid cross-loop pool reuse with the app.
168+
Clears global pools dict before creating a new pool to prevent connection exhaustion.
168169
"""
169170
import asyncpg # local import to avoid import at collection when skipped
171+
from cairo_coder.db import session as db_session
172+
173+
# Clear any lingering pools from the global dict to prevent connection exhaustion
174+
# during long test runs
175+
await db_session.close_pool()
170176

171177
raw_dsn = postgres_container.get_connection_url()
172178
# Convert SQLAlchemy-style DSN to asyncpg-compatible DSN

0 commit comments

Comments
 (0)