Files
hyperframes/packages
miga-heygen 73aa71c9ec fix(cli): guard PowerShell process queries against exited PIDs (#3571)
## Summary

`processIdentity` and `processParentPid` call `Get-CimInstance Win32_Process` to look up process metadata on Windows. When the target process has already exited, `Get-CimInstance` returns null and calling `.CreationDate.ToFileTimeUtc()` or `.ParentProcessId` on it throws `InvokeMethodOnNull`. The try/catch handles it, but PowerShell writes the error to stderr, which pollutes the test runner's output and causes spurious exit code 1 on Windows CI.

Two fixes per call site:
- Null-check the CimInstance before accessing properties (`$p = ...; if ($p) { $p.Property }`)
- `-ErrorAction SilentlyContinue` + `stdio: ["pipe", "pipe", "ignore"]` to suppress any residual stderr

Fixes the recurring `Tests on windows-latest` flake on main.

## Test plan

- [x] All 196 CLI test files pass locally
- [ ] Windows CI should no longer exit 1 from PowerShell stderr noise

— Miga
2026-08-31 17:15:39 -04:00
..
2026-08-31 15:16:22 -04:00
2026-08-31 15:16:22 -04:00
2026-08-31 15:16:22 -04:00
2026-08-31 15:16:22 -04:00
2026-08-31 15:16:22 -04:00
2026-08-31 15:16:22 -04:00
2026-08-31 15:16:22 -04:00
2026-08-31 15:16:22 -04:00
2026-08-31 15:16:22 -04:00