test: give the watcher-refresh and reader-only lifecycle tests Windows-runner deadlines

Merged
BO
3d ago
+14-4

The Windows lifecycle job stops failing at random in three tests whose deadlines were sized for Linux and macOS: the watcher refresh test ("preserves ownership on success" and "on failure") and the reader-only engine test's setup.

Seven failed Windows runs since 2026-10-15 trace to three limits, none to a hang:

TestLimit hitFailed runs
waits for the real daemon refresh … on successthe test's own 2 s readiness budget ("MCP readiness timed out")3
waits for the real daemon refresh … on failurethe test's 10 s limit1
reader-only MCP engine (#1963)Vitest's 10 s setup-hook default; the EPERM on cleanup that followed came from that still-running setup1

The same tests are simply slow and variable on Windows runners, even when they pass:

TestLinux/macOS CIWindows CI, passing runsWindows desktop, 20 runs (10 on 4 pinned cores)
refresh … on success (whole test)0.75 s2.0–2.5 s1.5–1.6 s
refresh itself, inside the 2 s budget—not loggedabout 0.3–0.57 s
reader-only async (setup + body)—2.8–11.6 s2.5–2.6 s
reader-only setup hook—not logged0.27–0.32 s max

On a desktop the work fits its budgets with room to spare, including when pinned to four cores; the Windows runner takes several times longer and sometimes far longer (one passing reader-only run took 11.6 s). This change raises only those deadlines, only on Windows: the readiness budget to 20 s, that test's limit to 30 s, and the reader-only setup hook and test to 30 s. Linux and macOS keep their current limits, and no assertion changes.

Checks

  • runtime-control.test.ts and mcp-writer-lock.test.ts, 67 of 67 pass on Linux (Node 24) and on a Windows checkout (Node 24.21) at this head.
  • The Windows lifecycle job on this PR is the cross-platform run.

README rows checked: none apply (tests only).

Not covered: the other Windows lifecycle failures seen once each in the same period (mcp-daemon disconnect before client hello, daemon-older-version upgraded session, and two other watcher-startup cases) are not changed here.


Summary by cubic

Raises deadline limits in three lifecycle tests that time out on Windows CI runners because their budgets were sized for Linux and macOS.

On Windows only, the watcher-refresh readiness budget goes from 2 s to 20 s, that test's overall limit from 10 s to 30 s, and the reader-only engine setup hook and test from Vitest's 10 s default to 30 s. Linux and macOS keep their current limits, and no assertions change.

Not covered

  • The other Windows lifecycle failures seen once each in the same period (daemon disconnect, older-version upgraded session, and two watcher-startup cases) are left as-is.

Summary by CodeRabbit

  • Tests
    • Updated Windows test time limits for MCP initialization and runtime refresh checks to accommodate slower execution. Timing on other platforms remains unchanged, helping keep automated test results consistent across supported environments. No end-user behavior changes are included in this update.