test(parallels): harden fresh gateway smoke

This commit is contained in:
Peter Steinberger
2026-04-28 23:35:52 +01:00
parent ab17e06057
commit f51008a8f6
3 changed files with 22 additions and 5 deletions

View File

@@ -42,7 +42,7 @@ TIMEOUT_ONBOARD_S=180
TIMEOUT_AGENT_S="${OPENCLAW_PARALLELS_LINUX_AGENT_TIMEOUT_S:-300}"
TIMEOUT_GATEWAY_S=240
PHASE_STALE_WARN_S=60
DISABLE_BONJOUR_FOR_GATEWAY=0
DISABLE_BONJOUR_FOR_GATEWAY=1
FRESH_MAIN_STATUS="skip"
FRESH_MAIN_VERSION="skip"

View File

@@ -1460,15 +1460,18 @@ EOF
}
verify_gateway() {
local attempt
for attempt in 1 2 3 4 5 6 7 8; do
if guest_current_user_exec "$GUEST_OPENCLAW_BIN" gateway status --deep --require-rpc --timeout 15000; then
local attempt deadline
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
return 0
fi
if (( attempt < 8 )); then
if (( SECONDS < deadline )); then
printf 'gateway-status retry %s\n' "$attempt" >&2
sleep 5
fi
attempt=$((attempt + 1))
done
return 1
}

View File

@@ -40,4 +40,18 @@ describe("Parallels smoke model selection", () => {
expect(script).toMatch(/parallels-windows-smoke\.sh"[\s\S]*?--model "\$MODEL_ID"/);
expect(script).toMatch(/parallels-linux-smoke\.sh"[\s\S]*?--model "\$MODEL_ID"/);
});
it("disables Bonjour by default for the standalone Linux gateway smoke", () => {
const script = readFileSync("scripts/e2e/parallels-linux-smoke.sh", "utf8");
expect(script).toContain("DISABLE_BONJOUR_FOR_GATEWAY=1");
expect(script).toContain("OPENCLAW_DISABLE_BONJOUR=1");
});
it("lets the macOS gateway status probe use the full phase budget", () => {
const script = readFileSync("scripts/e2e/parallels-macos-smoke.sh", "utf8");
expect(script).toContain("deadline=$((SECONDS + TIMEOUT_GATEWAY_S))");
expect(script).toContain("gateway status --deep --require-rpc --timeout 30000");
});
});