From dcaccdc5c44682ac5eb7b852b6022e8eb4af8a22 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 15 Apr 2026 10:52:40 +0100 Subject: [PATCH] test: cap e2e install update phases --- .../skills/openclaw-parallels-smoke/SKILL.md | 1 + .../openclaw-release-maintainer/SKILL.md | 1 + scripts/e2e/parallels-linux-smoke.sh | 2 +- scripts/e2e/parallels-macos-smoke.sh | 8 ++--- scripts/e2e/parallels-npm-update-smoke.sh | 36 ++++++++++++++++++- scripts/e2e/parallels-windows-smoke.sh | 11 +++--- 6 files changed, 48 insertions(+), 11 deletions(-) diff --git a/.agents/skills/openclaw-parallels-smoke/SKILL.md b/.agents/skills/openclaw-parallels-smoke/SKILL.md index 3665098a18e..d3291472780 100644 --- a/.agents/skills/openclaw-parallels-smoke/SKILL.md +++ b/.agents/skills/openclaw-parallels-smoke/SKILL.md @@ -22,6 +22,7 @@ Use this skill for Parallels guest workflows and smoke interpretation. Do not lo - Windows: `90m` - aggregate npm-update wrapper: `150m` If a lane hits the cap, stop there, inspect the newest `/tmp/openclaw-parallels-*` run directory and phase log, then fix or rerun the smallest affected lane. Do not keep waiting on a capped lane. +- Actual OpenClaw npm install/update phases are a stricter budget than whole lanes: they should finish within 5 minutes. If a phase named `install-main`, `install-latest`, `install-baseline`, `install-baseline-package`, `update-dev`, or same-guest `openclaw update` exceeds 300s, treat it as a failure/harness bug and start diagnosis from that phase log. Do not wait for a longer lane cap. - For a full OS matrix, prefer running independent guest-family lanes in parallel when host capacity allows: - `timeout --foreground 75m pnpm test:parallels:macos -- --json` - `timeout --foreground 90m pnpm test:parallels:windows -- --json` diff --git a/.agents/skills/openclaw-release-maintainer/SKILL.md b/.agents/skills/openclaw-release-maintainer/SKILL.md index e55c15225c5..6532077d84d 100644 --- a/.agents/skills/openclaw-release-maintainer/SKILL.md +++ b/.agents/skills/openclaw-release-maintainer/SKILL.md @@ -115,6 +115,7 @@ node --import tsx scripts/openclaw-npm-postpublish-verify.ts - `90m` for `pnpm test:docker:all` - Parallels caps from the `openclaw-parallels-smoke` skill If a lane hits its cap, stop and inspect/fix the affected lane before continuing; do not continue to wait on the same process. +- Actual npm install/update phases are capped at 5 minutes. If `npm install -g`, installer package install, or `openclaw update` takes longer than 300s in release e2e, stop treating the run as healthy progress and debug the installer/updater or harness. - Serialize host build/package mutations ahead of VM lanes. Finish `pnpm build`, `pnpm ui:build`, `pnpm release:check`, install smoke, and any Docker/package-prep lanes before starting Parallels `npm pack` lanes; otherwise `dist` can disappear during VM pack prep and produce false failures. - Include mac release readiness in preflight by running the public validation workflow in `openclaw/openclaw` and the real mac preflight in diff --git a/scripts/e2e/parallels-linux-smoke.sh b/scripts/e2e/parallels-linux-smoke.sh index f95626d0758..34ad9e064e0 100644 --- a/scripts/e2e/parallels-linux-smoke.sh +++ b/scripts/e2e/parallels-linux-smoke.sh @@ -32,7 +32,7 @@ BUILD_LOCK_DIR="${TMPDIR:-/tmp}/openclaw-parallels-build.lock" TIMEOUT_SNAPSHOT_S=180 TIMEOUT_BOOTSTRAP_S=600 -TIMEOUT_INSTALL_S=1200 +TIMEOUT_INSTALL_S=300 TIMEOUT_VERIFY_S=90 TIMEOUT_ONBOARD_S=180 TIMEOUT_AGENT_S=180 diff --git a/scripts/e2e/parallels-macos-smoke.sh b/scripts/e2e/parallels-macos-smoke.sh index 376f9ecba59..52767540bd3 100644 --- a/scripts/e2e/parallels-macos-smoke.sh +++ b/scripts/e2e/parallels-macos-smoke.sh @@ -44,10 +44,10 @@ SERVER_PID="" RUN_DIR="$(mktemp -d /tmp/openclaw-parallels-smoke.XXXXXX)" BUILD_LOCK_DIR="${TMPDIR:-/tmp}/openclaw-parallels-build.lock" -TIMEOUT_INSTALL_SITE_S=900 -TIMEOUT_INSTALL_TGZ_S=900 -TIMEOUT_INSTALL_REGISTRY_S=480 -TIMEOUT_UPDATE_DEV_S=1500 +TIMEOUT_INSTALL_SITE_S=300 +TIMEOUT_INSTALL_TGZ_S=300 +TIMEOUT_INSTALL_REGISTRY_S=300 +TIMEOUT_UPDATE_DEV_S=300 TIMEOUT_VERIFY_S=60 TIMEOUT_ONBOARD_S=180 TIMEOUT_GATEWAY_S=120 diff --git a/scripts/e2e/parallels-npm-update-smoke.sh b/scripts/e2e/parallels-npm-update-smoke.sh index 97bb1b13473..12ab4b58d48 100755 --- a/scripts/e2e/parallels-npm-update-smoke.sh +++ b/scripts/e2e/parallels-npm-update-smoke.sh @@ -31,6 +31,7 @@ UPDATE_EXPECTED_NEEDLE="" API_KEY_VALUE="" PROGRESS_INTERVAL_S=15 PROGRESS_STALE_S=60 +TIMEOUT_UPDATE_S=300 MACOS_FRESH_STATUS="skip" WINDOWS_FRESH_STATUS="skip" @@ -615,6 +616,32 @@ wait_job() { return 1 } +start_timeout_guard() { + local label="$1" + local timeout_s="$2" + local pid="$3" + local log_path="${4:-}" + ( + sleep "$timeout_s" + if kill -0 "$pid" >/dev/null 2>&1; then + warn "$label exceeded ${timeout_s}s; stopping" + if [[ -n "$log_path" ]]; then + dump_log_tail "$label" "$log_path" + fi + kill "$pid" >/dev/null 2>&1 || true + sleep 2 + kill -9 "$pid" >/dev/null 2>&1 || true + fi + ) & + printf '%s\n' "$!" +} + +stop_timeout_guard() { + local pid="${1:-}" + [[ -n "$pid" ]] || return 0 + kill "$pid" >/dev/null 2>&1 || true +} + extract_log_progress() { local log_path="$1" "$PYTHON_BIN" - "$log_path" <<'PY' @@ -794,7 +821,7 @@ run_windows_script_via_log() { log_state_path="$(mktemp "${TMPDIR:-/tmp}/openclaw-update-log-state.XXXXXX")" : >"$log_state_path" start_seconds="$SECONDS" - poll_deadline=$((SECONDS + 900)) + poll_deadline=$((SECONDS + TIMEOUT_UPDATE_S + 60)) startup_checked=0 guest_powershell "$(cat <"$RUN_DIR/linux-update.log" 2>&1 & linux_update_pid=$! +macos_update_guard_pid="$(start_timeout_guard "macOS update" "$TIMEOUT_UPDATE_S" "$macos_update_pid" "$RUN_DIR/macos-update.log")" +windows_update_guard_pid="$(start_timeout_guard "Windows update" "$TIMEOUT_UPDATE_S" "$windows_update_pid" "$RUN_DIR/windows-update.log")" +linux_update_guard_pid="$(start_timeout_guard "Linux update" "$TIMEOUT_UPDATE_S" "$linux_update_pid" "$RUN_DIR/linux-update.log")" monitor_jobs_progress "update" \ "macOS" "$macos_update_pid" "$RUN_DIR/macos-update.log" \ "Windows" "$windows_update_pid" "$RUN_DIR/windows-update.log" \ "Linux" "$linux_update_pid" "$RUN_DIR/linux-update.log" +stop_timeout_guard "$macos_update_guard_pid" +stop_timeout_guard "$windows_update_guard_pid" +stop_timeout_guard "$linux_update_guard_pid" + wait_job "macOS update" "$macos_update_pid" "$RUN_DIR/macos-update.log" && MACOS_UPDATE_STATUS="pass" || MACOS_UPDATE_STATUS="fail" wait_job "Windows update" "$windows_update_pid" "$RUN_DIR/windows-update.log" && WINDOWS_UPDATE_STATUS="pass" || WINDOWS_UPDATE_STATUS="fail" wait_job "Linux update" "$linux_update_pid" "$RUN_DIR/linux-update.log" && LINUX_UPDATE_STATUS="pass" || LINUX_UPDATE_STATUS="fail" diff --git a/scripts/e2e/parallels-windows-smoke.sh b/scripts/e2e/parallels-windows-smoke.sh index 2498567acea..9a49f30662d 100644 --- a/scripts/e2e/parallels-windows-smoke.sh +++ b/scripts/e2e/parallels-windows-smoke.sh @@ -39,7 +39,8 @@ RUN_DIR="$(mktemp -d /tmp/openclaw-parallels-windows.XXXXXX)" BUILD_LOCK_DIR="${TMPDIR:-/tmp}/openclaw-parallels-build.lock" TIMEOUT_SNAPSHOT_S=240 -TIMEOUT_INSTALL_S=1200 +TIMEOUT_GIT_SETUP_S=1200 +TIMEOUT_INSTALL_S=300 TIMEOUT_VERIFY_S=120 TIMEOUT_ONBOARD_S=240 TIMEOUT_ONBOARD_PHASE_S=$((TIMEOUT_ONBOARD_S + 60)) @@ -2249,9 +2250,9 @@ run_fresh_main_lane() { local install_log_phase phase_run "fresh.restore-snapshot" "$TIMEOUT_SNAPSHOT_S" restore_snapshot "$snapshot_id" || return $? phase_run "fresh.wait-for-user" "$TIMEOUT_SNAPSHOT_S" wait_for_guest_ready || return $? - if ! phase_run "fresh.ensure-git" "$TIMEOUT_INSTALL_S" ensure_guest_git "$host_ip"; then + if ! phase_run "fresh.ensure-git" "$TIMEOUT_GIT_SETUP_S" ensure_guest_git "$host_ip"; then phase_run "fresh.wait-for-user-retry" "$TIMEOUT_SNAPSHOT_S" wait_for_guest_ready || return $? - phase_run "fresh.ensure-git-retry" "$TIMEOUT_INSTALL_S" ensure_guest_git "$host_ip" || return $? + phase_run "fresh.ensure-git-retry" "$TIMEOUT_GIT_SETUP_S" ensure_guest_git "$host_ip" || return $? fi if phase_run "fresh.install-main" "$TIMEOUT_INSTALL_S" install_main_tgz "$host_ip" "openclaw-main-fresh.tgz"; then install_log_phase="fresh.install-main" @@ -2275,9 +2276,9 @@ run_upgrade_lane() { local baseline_version phase_run "upgrade.restore-snapshot" "$TIMEOUT_SNAPSHOT_S" restore_snapshot "$snapshot_id" || return $? phase_run "upgrade.wait-for-user" "$TIMEOUT_SNAPSHOT_S" wait_for_guest_ready || return $? - if ! phase_run "upgrade.ensure-git" "$TIMEOUT_INSTALL_S" ensure_guest_git "$host_ip"; then + if ! phase_run "upgrade.ensure-git" "$TIMEOUT_GIT_SETUP_S" ensure_guest_git "$host_ip"; then phase_run "upgrade.wait-for-user-retry" "$TIMEOUT_SNAPSHOT_S" wait_for_guest_ready || return $? - phase_run "upgrade.ensure-git-retry" "$TIMEOUT_INSTALL_S" ensure_guest_git "$host_ip" || return $? + phase_run "upgrade.ensure-git-retry" "$TIMEOUT_GIT_SETUP_S" ensure_guest_git "$host_ip" || return $? fi if upgrade_uses_host_tgz; then phase_run "upgrade.install-baseline-package" "$TIMEOUT_INSTALL_S" install_main_tgz "$host_ip" "openclaw-main-upgrade.tgz" || return $?