Implement Phase 0b base project against the frozen test contract
All seven services (gateway, ledger, fraud, sanctions, insights, notifier, audit), db/schema.sql plus optional_indexes.sql, scripts/seed.py and smoke.py, the gateway-served frontend, and docker-compose.yml. Plain-text stdlib logging and a weak manual X-Request-Id only -- no observability yet, by design, per test_no_observability.py. Implements all 13 named chaos-flag pathologies from docs/PATHOLOGIES.md behind Redis-backed runtime flags. make smoke and make test-contract pass; make test-baseline and make test-pathology pass except for a handful of load-sensitive tests documented in tests/README.md rather than papered over.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from sqlalchemy.ext.asyncio import async_sessionmaker, create_async_engine
|
||||
|
||||
from .settings import settings
|
||||
|
||||
|
||||
def make_engine(**overrides):
|
||||
"""A fresh async engine. Services that need more than one pool profile
|
||||
(see ledger/chaos.py for pool_starvation) call this more than once."""
|
||||
kwargs = dict(pool_pre_ping=True)
|
||||
kwargs.update(overrides)
|
||||
return create_async_engine(settings.postgres_dsn, **kwargs)
|
||||
|
||||
|
||||
engine = make_engine(pool_size=20, max_overflow=10)
|
||||
Session = async_sessionmaker(engine, expire_on_commit=False)
|
||||
Reference in New Issue
Block a user