mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 16:50:23 +00:00
test: harden parallels smoke reruns
This commit is contained in:
@@ -621,12 +621,21 @@ send -- "/bin/bash /tmp/openclaw-prl.sh; rc=\$?; rm -f /tmp/openclaw-prl.sh; pri
|
||||
log_user 1
|
||||
|
||||
set rc 1
|
||||
set saw_rc 0
|
||||
expect {
|
||||
-re {__OPENCLAW_RC__:(-?[0-9]+)} {
|
||||
set rc $expect_out(1,string)
|
||||
set saw_rc 1
|
||||
}
|
||||
eof {}
|
||||
}
|
||||
if {$saw_rc} {
|
||||
# Tahoe can leave `prlctl enter` attached even after the guest command has
|
||||
# printed its explicit rc marker. Close the transport once the marker lands so
|
||||
# consecutive guest_current_user_cli calls in the same phase do not block.
|
||||
catch close
|
||||
exit $rc
|
||||
}
|
||||
catch wait result
|
||||
exit $rc
|
||||
EOF
|
||||
|
||||
@@ -320,6 +320,28 @@ function Invoke-CaptureLogged {
|
||||
return ($output | Out-String).Trim()
|
||||
}
|
||||
|
||||
function Wait-GatewayRpcReady {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)][string]$OpenClawPath,
|
||||
[int]$Attempts = 10,
|
||||
[int]$SleepSeconds = 3
|
||||
)
|
||||
|
||||
for ($attempt = 1; $attempt -le $Attempts; $attempt++) {
|
||||
Write-ProgressLog "update.gateway-status.attempt-$attempt"
|
||||
try {
|
||||
Invoke-Logged 'openclaw gateway status' { & $OpenClawPath gateway status --deep --require-rpc }
|
||||
return
|
||||
} catch {
|
||||
if ($attempt -ge $Attempts) {
|
||||
throw
|
||||
}
|
||||
Write-ProgressLog "update.gateway-status.retry-$attempt"
|
||||
Start-Sleep -Seconds $SleepSeconds
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$env:PATH = "$env:LOCALAPPDATA\OpenClaw\deps\portable-git\cmd;$env:LOCALAPPDATA\OpenClaw\deps\portable-git\mingw64\bin;$env:LOCALAPPDATA\OpenClaw\deps\portable-git\usr\bin;$env:PATH"
|
||||
$tgz = Join-Path $env:TEMP 'openclaw-main-update.tgz'
|
||||
@@ -343,9 +365,8 @@ try {
|
||||
# Restart the gateway/service before verifying status or the next agent turn.
|
||||
Write-ProgressLog 'update.restart-gateway'
|
||||
Invoke-Logged 'openclaw gateway restart' { & $openclaw gateway restart }
|
||||
Start-Sleep -Seconds 5
|
||||
Write-ProgressLog 'update.gateway-status'
|
||||
Invoke-Logged 'openclaw gateway status' { & $openclaw gateway status --deep --require-rpc }
|
||||
Wait-GatewayRpcReady -OpenClawPath $openclaw
|
||||
Write-ProgressLog 'update.agent-turn'
|
||||
Invoke-CaptureLogged 'openclaw agent' { & $openclaw agent --agent main --session-id $SessionId --message 'Reply with exact ASCII text OK only.' --json } | Out-Null
|
||||
$exitCode = $LASTEXITCODE
|
||||
|
||||
Reference in New Issue
Block a user