diff --git a/.github/workflows/native-windows-startup.yml b/.github/workflows/native-windows-startup.yml index 6740f51f..4345e2a0 100644 --- a/.github/workflows/native-windows-startup.yml +++ b/.github/workflows/native-windows-startup.yml @@ -109,19 +109,18 @@ jobs: } Write-Host "OK: start.ps1 path discovery - all guards passed." - # taskkill /T walks the process tree, /F forces. taskkill exits - # non-zero if the PID is already gone (server.py crashed on the - # stub) — that's expected, not a failure. + # taskkill /T walks the process tree, /F forces. taskkill returns + # 128 ("process not found") if the PID is already gone — that's + # the expected steady state for this mock-only workflow because + # server.py exits immediately on the stub hermes_cli. Reset + # $LASTEXITCODE so the step never fails on the cleanup itself. - name: Stop background server (tree-kill) if: always() shell: pwsh run: | if ($env:SERVER_PID) { - try { - & taskkill /PID $env:SERVER_PID /T /F 2>&1 | Out-Host - } catch { - Write-Host "taskkill: PID $env:SERVER_PID already exited (expected with mock stub)" - } + & taskkill /PID $env:SERVER_PID /T /F 2>&1 | Out-Host + $global:LASTEXITCODE = 0 } # Belt-and-suspenders: kill anything still bound to 8787. $hanging = Get-NetTCPConnection -LocalPort 8787 -State Listen -ErrorAction SilentlyContinue @@ -130,3 +129,4 @@ jobs: try { Stop-Process -Id $c.OwningProcess -Force -ErrorAction Stop } catch {} } } + exit 0