test(parallels): extend cold Windows and macOS gateway proof

This commit is contained in:
Peter Steinberger
2026-04-29 00:18:29 +01:00
parent 18f65c2d58
commit 03195583fe
3 changed files with 32 additions and 4 deletions

View File

@@ -1460,15 +1460,33 @@ EOF
}
verify_gateway() {
local attempt deadline
local attempt deadline probe_json
attempt=1
deadline=$((SECONDS + TIMEOUT_GATEWAY_S))
while (( SECONDS < deadline )); do
if guest_current_user_exec "$GUEST_OPENCLAW_BIN" gateway status --deep --require-rpc --timeout 30000; then
if probe_json="$(
guest_current_user_exec "$GUEST_OPENCLAW_BIN" gateway probe \
--url ws://127.0.0.1:18789 \
--timeout 30000 \
--json
)"; then
printf '%s\n' "$probe_json"
if PROBE_JSON="$probe_json" python3 - <<'PY'
import json
import os
payload = json.loads(os.environ["PROBE_JSON"])
raise SystemExit(0 if payload.get("ok") else 1)
PY
then
return 0
fi
elif ! guest_current_user_exec "$GUEST_OPENCLAW_BIN" gateway probe --help >/dev/null 2>&1 &&
guest_current_user_exec "$GUEST_OPENCLAW_BIN" gateway status --deep --require-rpc --timeout 30000; then
return 0
fi
if (( SECONDS < deadline )); then
printf 'gateway-status retry %s\n' "$attempt" >&2
printf 'gateway-probe retry %s\n' "$attempt" >&2
sleep 5
fi
attempt=$((attempt + 1))

View File

@@ -52,7 +52,7 @@ TIMEOUT_ONBOARD_S=600
TIMEOUT_ONBOARD_PHASE_S=$((TIMEOUT_ONBOARD_S + 120))
# verify_gateway_reachable runs six 30s probes plus short retry sleeps.
TIMEOUT_GATEWAY_S=420
TIMEOUT_AGENT_S="${OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S:-900}"
TIMEOUT_AGENT_S="${OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S:-1500}"
PHASE_STALE_WARN_S=60
FRESH_MAIN_STATUS="skip"

View File

@@ -52,6 +52,8 @@ describe("Parallels smoke model selection", () => {
const script = readFileSync("scripts/e2e/parallels-macos-smoke.sh", "utf8");
expect(script).toContain("deadline=$((SECONDS + TIMEOUT_GATEWAY_S))");
expect(script).toContain("gateway probe");
expect(script).toContain("--url ws://127.0.0.1:18789");
expect(script).toContain("gateway status --deep --require-rpc --timeout 30000");
});
@@ -61,4 +63,12 @@ describe("Parallels smoke model selection", () => {
expect(script).toContain('agent_log="/tmp/openclaw-parallels-agent-turn.log"');
expect(script).toContain("run_logged_guest_current_user_sh");
});
it("keeps the Windows first agent turn patient enough for cold package startup", () => {
const script = readFileSync("scripts/e2e/parallels-windows-smoke.sh", "utf8");
expect(script).toContain(
'TIMEOUT_AGENT_S="${OPENCLAW_PARALLELS_WINDOWS_AGENT_TIMEOUT_S:-1500}"',
);
});
});