From 7928e83cc544bab9a3aeaba348451223d4f9d0b8 Mon Sep 17 00:00:00 2001 From: 0xrsydn Date: Mon, 30 Mar 2026 12:35:22 +0700 Subject: [PATCH] test: reset smoke cache between warm cases Clear the smoke cache before each cache-group warm case so the following offline and stale-cache checks always start from a fresh baseline instead of earlier group state. Document the runner behavior in the smoke guide to make the cache-group sequencing explicit. --- docs/SMOKE.md | 1 + scripts/live-smoke.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/docs/SMOKE.md b/docs/SMOKE.md index a5051f1..6edb24a 100644 --- a/docs/SMOKE.md +++ b/docs/SMOKE.md @@ -39,5 +39,6 @@ scripts/live-smoke.sh --dry-run --mode full ## Notes - The runner forces `IDX_OUTPUT=table` as its default environment so table cases stay stable; JSON checks use `-o json` explicitly. +- Cache-group warm cases clear the smoke cache before they run so each warm/offline/stale sequence starts clean and stale-cache assertions are not masked by earlier groups. - Ownership commands that need imported data are intentionally not part of the baseline runner yet. The current baseline only covers `ownership releases` and the known unsupported `ownership import --fetch-bing`. - When a case fails, inspect the per-case log in `tmp/live-smoke/.../logs/` before updating `TODO.md` or `FEATURE_SPEC.md`. diff --git a/scripts/live-smoke.sh b/scripts/live-smoke.sh index d08ef75..44bee9e 100755 --- a/scripts/live-smoke.sh +++ b/scripts/live-smoke.sh @@ -400,6 +400,21 @@ prepare_environment() { bootstrap_case "ownership-db" config set ownership.db_path "$OWNERSHIP_DB" } +cache_case_starts_fresh() { + local group="$1" + local label="$2" + + [[ "$group" == "cache" && "$label" == *"-warm" ]] +} + +reset_cache_for_case() { + local label="$1" + + # Cache checks need a clean starting point so the warm/offline/stale trio + # validates TTL-sensitive fallback behavior instead of reusing prior group state. + bootstrap_case "cache-reset-${label}" cache clear +} + sanitize_name() { printf '%s' "$1" | tr -cs 'A-Za-z0-9._-' '_' } @@ -433,6 +448,10 @@ run_case_line() { printf '[%02d] %-10s %s\n' "$TOTAL_CASES" "$group" "$label" + if cache_case_starts_fresh "$group" "$label"; then + reset_cache_for_case "$label" + fi + if (( DRY_RUN )); then printf ' %s\n' "$(command_display "$env_spec" "$cmd_spec")" return 0