#!/usr/bin/env python3 """Grade-4 Redis/Postgres failure injection for isolated local Compose environment. Requires Docker permissions; never uses 'down -v'. Never prints tokens. """ import subprocess import time from client import Client, Failure, check, run def compose(*args): outcome = subprocess.run(['docker','compose','--env-file','.env',*args], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) check(outcome.returncode==0, 'docker compose action failed; inspect locally') def wait_ready(c, status): until = time.monotonic()+60 while time.monotonic()