diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-05 02:42:37 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-05 02:42:37 +0300 |
| commit | c51068448f393f5a5d024bc41b704297113cf625 (patch) | |
| tree | 2599fe16205b8068d1bd7e2e83b69b0f95dccdd5 | |
| parent | 697290942820f8a0227440a1ca384173f8ccc5e8 (diff) | |
test: keep windows smoke cleanup non-fatal
| -rw-r--r-- | scripts/windows_smoke_conpty_path.ps1 | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/windows_smoke_conpty_path.ps1 b/scripts/windows_smoke_conpty_path.ps1 index 41f637fc..76229275 100644 --- a/scripts/windows_smoke_conpty_path.ps1 +++ b/scripts/windows_smoke_conpty_path.ps1 @@ -89,9 +89,15 @@ try { $deadline = (Get-Date).AddSeconds(15) do { Start-Sleep -Milliseconds 500 - $read = & $exe agent read smoke --source recent --lines 40 --format text 2>&1 + try { + $read = & $exe agent read smoke --source recent --lines 40 --format text 2>&1 + $readExitCode = $LASTEXITCODE + } catch { + $read = @($_.Exception.Message) + $readExitCode = 1 + } $text = $read -join "`n" - if ($LASTEXITCODE -eq 0 -and $text -match "File\(s\)" -and $text -match "Dir\(s\)") { + if ($readExitCode -eq 0 -and $text -match "File\(s\)" -and $text -match "Dir\(s\)") { break } } while ((Get-Date) -lt $deadline) @@ -101,9 +107,17 @@ try { } } finally { if ($null -ne $server) { - & $exe server stop 2>$null + try { + $stopOutput = & $exe server stop 2>&1 + if ($LASTEXITCODE -ne 0) { + Write-Host "server stop during cleanup exited with $LASTEXITCODE`: $($stopOutput -join "`n")" + } + } catch { + Write-Host "server stop during cleanup failed: $($_.Exception.Message)" + } Wait-Process -Id $server.Id -Timeout 10 -ErrorAction SilentlyContinue } + $global:LASTEXITCODE = 0 $env:PATH = $oldPath $env:HERDR_SESSION = $oldSession Remove-Item -Recurse -Force $fakeDir -ErrorAction SilentlyContinue |
