diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 82aa2f60c..f4f486d5c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -216,8 +216,14 @@ jobs: run: | $payload = Resolve-Path 'packaging\windows\igneum-windows-app' function Run-Capture([string]$exe, [string]$flag) { + # Start-Process -Wait on an exe that exits in milliseconds can throw "Cannot process request because the process has + # exited" before it attaches (release-0.3.21 run 37653903394, 7 October 2026, 17:40 UK): one retry before the verdict. $out = Join-Path $env:RUNNER_TEMP ('smoke-' + [IO.Path]::GetRandomFileName() + '.txt') - $p = Start-Process -FilePath $exe -ArgumentList $flag -Wait -NoNewWindow -PassThru -RedirectStandardOutput $out + $p = $null + foreach ($try in 1, 2) { + try { $p = Start-Process -FilePath $exe -ArgumentList $flag -Wait -NoNewWindow -PassThru -RedirectStandardOutput $out; break } + catch { if ($try -eq 2) { throw }; Write-Host ("Start-Process on {0} {1} failed once ({2}); second try" -f (Split-Path -Leaf $exe), $flag, $_.Exception.Message); Start-Sleep -Milliseconds 500 } + } $text = if (Test-Path $out) { (Get-Content $out -Raw) } else { '' } Write-Host ("{0} {1} -> exit {2}: {3}" -f (Split-Path -Leaf $exe), $flag, $p.ExitCode, $text.Trim()) if ($p.ExitCode -ne 0) { throw "$exe $flag exited $($p.ExitCode)" }