Files
Matt Godbolt 885a5b8d8e Fix flaky Windows exec timeout test (#8765)
## Problem

The Windows variant of the `Execution tests > Executes external commands
> handles timeouts` test (`test/exec-tests.ts`) is flaky on CI. It ran:

```ts
exec.execute('powershell', ['-Command', '"sleep 5"'], {timeoutMs: 10})
```

The embedded double-quotes make `"sleep 5"` a **string literal** that
PowerShell just echoes and exits immediately — it never sleeps. The test
only "passed" by racing the 10 ms timeout against PowerShell's startup.
When PowerShell wins the race it returns `code: 0` / `stdout: "sleep 5"`
instead of the expected killed result, intermittently failing the
Windows `test` job.

(Spotted while verifying CI on #8737 — the only failure there was this
test, unrelated to that PR.)

## Fix

Use `Start-Sleep -Seconds 5`, which actually blocks, so the 10 ms
timeout deterministically kills it. The expected result block is
unchanged (`code: 1` is what `taskkill` yields for an externally-killed
process on Windows). Added a comment explaining the rationale, and fixed
the `timouts` → `timeouts` typo in both the Windows and POSIX test
names.

## Testing

- POSIX branch runs locally: `npx vitest run test/exec-tests.ts` → 22
passed.
- The Windows branch can only run on a Windows runner; the change is
confined to the command string and leaves the assertion identical.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 17:43:25 -05:00
..
2021-10-05 01:45:05 +02:00
2019-08-21 01:26:16 +02:00
2025-01-29 10:41:03 -06:00
2021-09-13 20:22:27 +02:00
2024-10-27 15:28:38 +02:00
2024-10-26 17:42:22 +02:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2026-02-08 12:50:20 +01:00
2024-03-08 22:25:09 -06:00
2024-03-08 22:25:09 -06:00
2025-07-28 10:34:46 -05:00