Provider Lifecycle¶
Every provider follows DatabaseProvider:
- Construct the provider with an image or local database path.
- Start the provider.
- Poll until the database accepts a real connection or query.
- Return a consumer connection URL.
- Reset user objects between scenarios when requested.
- Collect diagnostics and logs on failure.
- Stop and dispose the provider in
finally.
Why readiness is more than a port¶
A published Docker port can accept TCP connections while the database is still
initializing users, schemas, or system tables. DockerDatabaseProvider polls
the engine through SQLAlchemy. ClickHouse uses its native client because its
HTTP protocol is not represented by a generic SQLAlchemy URL.
Isolation¶
Reset tests create a probe table, reset the provider, and verify that the table is gone. This prevents one scenario from making a later scenario pass or fail because of leftover state.