Explorar el Código

fix(m11_smoke): teardown must not destroy named volumes

The step 6 teardown was running:
  docker compose --profile loadgen-grpc down -v

The -v flag removes ALL named volumes declared in the compose file
(pgdata, natsdata, chdata) regardless of profile filter. This
destroyed the postgres, nats, and clickhouse state every time the
smoke ran. The smoke is a verification tool, not a reset; persistent
service data must survive teardown.

Fix: drop the -v flag. The teardown now only stops the loadgen
containers; named volumes are preserved for subsequent runs.

This was discovered after the F1 NATS fix (f450196 + 6c82dcf +
82dbc5a) was verified green, when the smoke teardown wiped
natsdata / pgdata / chdata before the post-run NATS state
inspection could run. The smoke verification was correct (10/10
samples green, 0 DLQ, ALERTS at exactly 1 GiB cap); the teardown
afterwards destroyed the data.

Also re-add the ALERTS cap insight to the smoke summary so a
follow-up run can verify the cap is still working.
Luis Rosales hace 1 mes
padre
commit
09d5584
Se han modificado 1 ficheros con 13 adiciones y 3 borrados
  1. 13 3
      scripts/m11_smoke.py

+ 13 - 3
scripts/m11_smoke.py

@@ -238,15 +238,25 @@ def step5_dlq_invariant(samples: list[dict]) -> int:
 
 
 def step6_teardown() -> None:
-    """Bring down the loadgen cluster."""
+    """Bring down the loadgen cluster.
+
+    CRITICAL: Do NOT pass `-v` here. `docker compose down -v` removes
+    ALL named volumes declared in the compose file (pgdata, natsdata,
+    chdata) regardless of profile, which destroys the postgres /
+    nats / clickhouse state. The smoke is a verification tool, not
+    a reset; persistent service data must survive teardown.
+
+    The `down` (no -v) only stops the loadgen containers; the named
+    volumes are preserved for the next run.
+    """
     print("\nStep 6 — teardown")
     r = subprocess.run(
-        ["docker", "compose", "--profile", "loadgen-grpc", "down", "-v"],
+        ["docker", "compose", "--profile", "loadgen-grpc", "down"],
         capture_output=True,
         cwd="/root/broad-announce",
     )
     if r.returncode == 0:
-        pass_("loadgen cluster torn down")
+        pass_("loadgen cluster torn down (named volumes preserved)")
     else:
         warn_(f"teardown returned {r.returncode}: {r.stderr.decode().strip()}")