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.
This commit is contained in:
Rasyidan Akbar F. 2026-03-30 12:35:22 +07:00
commit 7928e83cc5
2 changed files with 20 additions and 0 deletions

View file

@ -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