From 0f77fdf4a059d852ac1d07756e2a65cfa918b1ae Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 11 Apr 2026 16:14:14 +0100 Subject: [PATCH] test: tolerate Windows gateway restart timeout --- scripts/e2e/parallels-npm-update-smoke.sh | 30 +++++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/scripts/e2e/parallels-npm-update-smoke.sh b/scripts/e2e/parallels-npm-update-smoke.sh index ecb3a9f10bc..d3ee7ad203f 100755 --- a/scripts/e2e/parallels-npm-update-smoke.sh +++ b/scripts/e2e/parallels-npm-update-smoke.sh @@ -408,13 +408,33 @@ function Restart-GatewayWithRecovery { ) $restartFailed = $false - try { - Invoke-Logged 'openclaw gateway restart' { & $OpenClawPath gateway restart } - } catch { + $restartJob = Start-Job -ScriptBlock { + param([string]$Path) + $output = & $Path gateway restart *>&1 + [pscustomobject]@{ + ExitCode = $LASTEXITCODE + Output = ($output | Out-String).Trim() + } + } -ArgumentList $OpenClawPath + + $restartCompleted = Wait-Job $restartJob -Timeout 20 + if ($null -ne $restartCompleted) { + $restartResult = Receive-Job $restartJob + if ($null -ne $restartResult.Output -and $restartResult.Output.Length -gt 0) { + $restartResult.Output | Tee-Object -FilePath $LogPath -Append | Out-Null + } + if ($restartResult.ExitCode -ne 0) { + $restartFailed = $true + Write-ProgressLog 'update.restart-gateway.soft-fail' + "openclaw gateway restart failed with exit code $($restartResult.ExitCode)" | Tee-Object -FilePath $LogPath -Append | Out-Null + } + } else { $restartFailed = $true - Write-ProgressLog 'update.restart-gateway.soft-fail' - ($_ | Out-String) | Tee-Object -FilePath $LogPath -Append | Out-Null + Stop-Job $restartJob -ErrorAction SilentlyContinue + Write-ProgressLog 'update.restart-gateway.timeout' + 'openclaw gateway restart timed out after 20s; continuing to RPC readiness checks' | Tee-Object -FilePath $LogPath -Append | Out-Null } + Remove-Job $restartJob -Force -ErrorAction SilentlyContinue Write-ProgressLog 'update.gateway-status' try {