pp-test: restore drops caches before production load; all-mode EXIT trap auto-restores; ssh ConnectTimeout

This commit is contained in:
Frank
2026-08-16 10:17:01 -07:00
parent 1716bf37c9
commit 750730e4d9
+8 -2
View File
@@ -39,8 +39,8 @@ fi
log() { echo "[pp-test] $*"; }
die() { echo "[pp-test] FAIL: $*" >&2; exit 1; }
ssh_claw() { ssh -o BatchMode=yes "$CLAW" "$@"; }
ssh_server() { ssh -o BatchMode=yes "$SERVER" "$@"; }
ssh_claw() { ssh -o BatchMode=yes -o ConnectTimeout=8 "$CLAW" "$@"; }
ssh_server() { ssh -o BatchMode=yes -o ConnectTimeout=8 "$SERVER" "$@"; }
# ---------------------------------------------------------------------------
# preflight
@@ -158,6 +158,9 @@ do_stop_pp() {
}
do_restore() {
# Warm-cache loads crash fast on the claw (AGENTS.md); cold loads survive.
log "dropping page caches on claw before production load"
ssh_claw "$SUDO sh -c 'sync; echo 3 > /proc/sys/vm/drop_caches'" || log "WARN: cache drop failed"
log "starting production services"
ssh_server "$SUDO systemctl start frank-default-small" || die "could not start frank-default-small"
ssh_claw "$SUDO systemctl start frank-default-large" || die "could not start frank-default-large"
@@ -185,11 +188,14 @@ case "${1:-}" in
stop-pp) do_stop_pp ;;
restore) do_restore ;;
all)
log "full run: any failure auto-restores production services"
do_preflight
trap 'do_restore || true' EXIT
do_start
do_verify
do_bench
do_restore
trap - EXIT
;;
*)
echo "Usage: $0 {preflight|start|verify|bench [prompt_k] [out] [reps]|stop-pp|restore|all}"