Files
LedgerLine/services/gateway/chaos.py
T
Movses Aslanyan 91afea92a1 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.
2026-09-05 08:12:30 +03:30

24 lines
582 B
Python

"""retry_storm, no_batching, chatty_health -- phase-0-base-project-spec.md §7.
All three are owned by `gateway`."""
import random
from common.chaos_flags import is_enabled
DOWNSTREAMS = ("ledger", "fraud", "sanctions", "insights", "notifier")
async def retry_storm_enabled() -> bool:
return await is_enabled("retry_storm")
async def no_batching_enabled() -> bool:
return await is_enabled("no_batching")
async def chatty_health_enabled() -> bool:
return await is_enabled("chatty_health")
def synthetic_line_item_count() -> int:
return random.randint(1, 5)