PostgreSQL Test Warnings Status
What we tried
- Reworked
backends/netherframe.backends.postgresqlbackend cleanup to await pool closes and avoid cross-loop issues. - Added a custom PostgreSQL container subclass to avoid the deprecated
@wait_container_is_readydecorator and used manual readiness checks. - Ran full suite with its container tests enabled (now
pytest --nf-use-containers); all tests pass.
Remaining warnings and why
- Deprecation warnings:
testcontainers4.14.0 still emits deprecation notices whentestcontainers.core.waiting_utilsis imported (the module uses@wait_container_is_readyinternally). Although structured wait strategies now exist (testcontainers.core.wait_strategies.LogMessageWaitStrategy,ExecWaitStrategy, etc.), the warning is triggered at import time, so we cannot avoid it without upgrading/patching the library. - Runtime warnings about
Pool.closenot awaited: These surface during testcontainers teardown when the Postgres container stops and asyncpg attempts to close pools on shutting event loops. Backend code now awaits its own pools; the warnings originate upstream in testcontainers/asyncpg teardown.
Next steps to fully remove warnings
- Upgrade or patch testcontainers to a release that supports structured wait strategies (e.g.,
container.waiting_for(LogMessageWaitStrategy(...))) and removes the deprecated decorator usage. - Adjust teardown in testcontainers (or vendor a minimal wrapper) so pool.close is awaited on a live loop during container shutdown.
Until testcontainers is upgraded or patched, the warnings are expected despite the backend and tests passing. The codebase changes here focus on keeping our side clean; remaining messages are upstream.
Note: The @wait_container_is_ready warning is expected to disappear in the next testcontainers release; once we upgrade, we should be able to remove the filterwarnings entry.