From cb0e789107597f1be45be9023923cac37234280b Mon Sep 17 00:00:00 2001 From: MK Date: Tue, 11 Aug 2026 12:55:30 +0800 Subject: [PATCH] test(snapshots): stop Windows network stalls from timing out PTY cases Two snapshot cases intermittently fail the Windows leg with "timed out after 60s" and empty partial output (run 31453833634, attempts 2 and 4; same stall class as #2390): - migration_eslint: the fixture has no Node version pin, so the global vp resolves "latest LTS" through a nodejs.org/dist/index.json fetch before it spawns node and prints anything. Each case runs in a fresh VP_HOME and the CI runtime seed carries no index cache, so every such case fetches the index, and a stalled connection spends the whole 60s step budget with no output. - command_cache_bun: the case provisions bun@1.3.11 into its fresh VP_HOME, and a stalled tarball download holds the request for vp's full download timeout (10 minutes since #2386), so the retry never gets a chance inside the step budget. Two fixes: - Warm the version index cache in the snapshot jobs' prewarm step with `vp env list-remote`, so `node/index_cache.json` lands in the seeded js_runtime dir. nodejs.org serves the index with a one-hour max-age, which covers the whole suite, and vp falls back to an existing cache when a later fetch fails. - Set VP_DOWNLOAD_TIMEOUT=30 (the #2386 knob) in every case's env in the runner, so a stalled runtime or package-manager download fails fast enough for vp's retry to finish inside the 60s step budget. Healthy CI downloads take about a second. Verified with `cargo check -p vp_cli_snapshots --tests` plus local runs of command_cache_bun and dev_engines_runtime_pnpm10 (both pass; the installed vp 0.2.8 ignores the unknown env var, while CI builds vp from HEAD where the cap is active). migration_eslint needs the JS dist that a fresh worktree lacks, so CI covers that case. Claude-Session: https://claude.ai/code/session_015ALfSFSa1Q2BN198bkDbpr --- .github/workflows/ci.yml | 12 ++++++++++++ crates/vp_cli_snapshots/tests/cli_snapshots/main.rs | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cef2e8c0f8..fa639cc6ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -970,6 +970,12 @@ jobs: run: | "$HOME/.vite-plus/bin/vp" node --version \ || echo "prewarm failed; cases will download the runtime on demand" + # Warm the Node.js version index cache (~1h TTL) into the runtime + # seed. Cases without a version pin resolve "latest LTS" before + # their first output, and a stalled nodejs.org fetch there times + # out the 60s step budget (same stall class as #2390). + "$HOME/.vite-plus/bin/vp" env list-remote > /dev/null \ + || echo "index prewarm failed; cases will fetch the version index on demand" - name: Install Playwright Chromium run: pnpm exec playwright install chromium @@ -1059,6 +1065,12 @@ jobs: run: | "$USERPROFILE/.vite-plus/bin/vp.exe" node --version \ || echo "prewarm failed; cases will download the runtime on demand" + # Warm the Node.js version index cache (~1h TTL) into the runtime + # seed. Cases without a version pin resolve "latest LTS" before + # their first output, and a stalled nodejs.org fetch there times + # out the 60s step budget (same stall class as #2390). + "$USERPROFILE/.vite-plus/bin/vp.exe" env list-remote > /dev/null \ + || echo "index prewarm failed; cases will fetch the version index on demand" - name: Install Playwright Chromium shell: bash diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs b/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs index c0991f0014..23dc1572de 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs @@ -653,6 +653,12 @@ impl CaseHome { env.insert("TERM".into(), "xterm-256color".into()); env.insert("VP_CLI_TEST".into(), "1".into()); env.insert("NODE_NO_WARNINGS".into(), "1".into()); + // Cap download attempts far below vp's 10-minute default: a stalled + // runtime or package-manager download must fail fast enough for vp's + // retry (3 attempts, exponential backoff) to finish inside the 60s + // step budget. Healthy CI downloads take ~1s; Windows runners stall + // intermittently (see command_cache_bun in the #2390 stall class). + env.insert("VP_DOWNLOAD_TIMEOUT".into(), "30".into()); env.insert("VP_HOME".into(), self.vp_home().into_os_string()); if cfg!(windows) { env.insert("USERPROFILE".into(), self.home.clone().into_os_string());