From 064decf5ff78b80185bdd4979753b0bbdc6ae5d9 Mon Sep 17 00:00:00 2001 From: stroblme Date: Thu, 15 Oct 2026 15:57:46 +0200 Subject: [PATCH] Soak's redis scenario refuses to run without --force It stops the Redis the whole stack journals to, so every flow fails briefly, not just the soak fixtures. `all` includes it and needs the flag too. --- Makefile | 2 +- backend/scripts/soak.py | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 45830f2..43058cd 100644 --- a/Makefile +++ b/Makefile @@ -204,7 +204,7 @@ test-frontend: ## Run frontend tests (Playwright e2e) against the local stack # Load and chaos against a *running* stack, never part of `make test`: it # restarts this stack's containers. `SOAK_ARGS="--dry-run"` only looks. -soak: ## Run the soak/chaos harness (SOAK_ARGS="--minutes 30 --scenario redis") +soak: ## Run the soak/chaos harness (SOAK_ARGS="--minutes 30 --scenario redis --force") cd backend && uv run python scripts/soak.py $(SOAK_ARGS) bench-startup: ## Time submitting a run (BENCH_ARGS="--kedro ../some/kedro/project") diff --git a/backend/scripts/soak.py b/backend/scripts/soak.py index 8ba85ac..609fca5 100644 --- a/backend/scripts/soak.py +++ b/backend/scripts/soak.py @@ -4,11 +4,14 @@ Standalone on purpose, and never part of the test run. It drives the running stack through the *durable* path — the webhook, which journals every trigger to the work queue — and then takes pieces of the stack away to see what survives. - make soak - make soak SOAK_ARGS="--minutes 30 --rps 25" - make soak SOAK_ARGS="--scenario redis" + make soak SOAK_ARGS="--force" + make soak SOAK_ARGS="--minutes 30 --rps 25 --scenario load" + make soak SOAK_ARGS="--scenario redis --force" make soak SOAK_ARGS="--dry-run" +The redis scenario, which `all` includes, needs `--force`: the Redis it stops +is the one the whole stack journals to, not a copy of its own. + Every docker verb goes through :func:`docker`, which refuses any container that is not part of this project's compose stack. The machine this runs on hosts unrelated services; nothing here may ever reach them. @@ -936,7 +939,18 @@ def parse_args(argv: list[str] | None) -> argparse.Namespace: action="store_true", help="Report what the harness can see and change nothing.", ) + parser.add_argument( + "--force", + action="store_true", + help="Allow the redis scenario, which stops the Redis the whole stack shares.", + ) args = parser.parse_args(argv) + if args.scenario in ("all", "redis") and not (args.force or args.dry_run): + parser.error( + f"the redis scenario stops {REDIS}, which the whole stack shares, so " + "every flow briefly fails to journal, not just the soak fixtures. " + "Pass --force on a stack nobody relies on, or pick another --scenario." + ) args.rps = max(1, min(MAX_RPS, args.rps)) args.seconds = max(10.0, args.minutes * 60) return args