fix(ci): windows-x86 SSH probe — Bun.spawnSync timeout returns null exitCode#93
Conversation
…ilure The second, independent host-OpenSSH batch-login check in "SSH key installed for quickchr managed user" only ever decoded stdout, so a failure collapsed to Received: "" with no trace of why — the same diagnostic blindness #88 fixed in verifyBatchLogin() itself, just not applied to the test's own duplicate probe. Two windows-x86/stable CI runs post-#88 (29097379124, 29106310402) hit this exact assertion with an empty stdout ~500ms after account creation, while the internal verifyBatchLogin() succeeded silently both times — a different, not-yet-diagnosed failure from #87's NUL bug. This is instrumentation only, to capture what ssh actually says on the next occurrence.
… verifyBatchLogin) Bun.spawnSync's timeout option reproduced 3/3 on windows-x86 as an instant, undiagnosable exitCode: null with empty stdout+stderr (~400ms after account creation — nowhere near any real timeout), confirmed by the prior commit's stderr/exit-code instrumentation. verifyBatchLogin() (src/lib/provision.ts) uses async Bun.spawn() with a manual kill timer instead and has never failed that way in the same CI runs. Switching the test's own duplicate probe to the same shape to test that as the root cause directly.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe provisioning test replaces synchronous SSH verification with asynchronous ChangesSSH verification
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR addresses a Windows/x86 CI failure in the integration SSH batch-login probe by replacing Bun.spawnSync(..., { timeout }) with an async Bun.spawn() + manual kill timer pattern (matching verifyBatchLogin()), improving reliability and diagnosability on Windows.
Changes:
- Reworked the provisioning integration test’s independent SSH probe from
spawnSyncto asyncspawnwith a manual timeout kill. - Added in-test commentary documenting the Windows-specific failure mode observed with
spawnSynctimeouts. - Improved failure logging by including exit code and combined output on probe failure.
- Initialize the output accumulator up front instead of a bare `let x: string` only assigned on the happy path. - Match success against combined stdout+stderr, like verifyBatchLogin() does, instead of stdout alone — avoids missing a success message ssh happened to emit on stderr, and keeps the two probes consistent.
Summary
Fixes #92 — a second, distinct windows-x86 SSH batch-login CI failure (not #87, which
is already fixed and confirmed not reproducing).
test/integration/provisioning.test.ts's independent SSH login probe (separate fromverifyBatchLogin()insrc/lib/provision.ts, which fix(provision): Windows batch-login verification (ssh -F NUL) #88 already instrumented) onlychecked
stdout, so a failure collapsed toReceived: ""with no diagnosable trace.failure 3/3 on a narrow
windows-x86+provisioning.test.ts+stabledispatch:[ssh probe] exit null: <no output>—Bun.spawnSync'stimeoutoption returning aninstant, empty result (~400ms after account creation, nowhere near the 20s timeout or
any plausible connection/network delay).
verifyBatchLogin()uses asyncBun.spawn()+ a manualsetTimeout-based kill insteadof
Bun.spawnSync'stimeoutoption, and has never failed this way. Rewriting thetest's probe to the same shape (second commit) was tested directly and passed 3/3
across a second round of narrow dispatches — the fix holds.
CI already runs the latest stable Bun (1.3.14, unpinned
oven-sh/setup-bun, shipped2026-07-08) — this isn't a stale-runtime gap. Full root-cause writeup, evidence, and an
open question about a second
spawnSync(..., timeout)call site(
test/lab/ssh-keys/run-matrix.ts, also exercised on Windows vialab.yml) are in #92.Test plan
bun run check— cleanintegration.yml -f platforms=windows-x86 -f test-filter=provisioning.test.ts -f routeros-targets=stable -f run-examples=false, repeated:[ssh probe] exit null: <no output>— runs29116468133,29116483756,2911648808629117958656,29117963187,29117967629(that batch's one job failure was the unrelated CI: provisioning.test.ts fixed 360s timeout can be shorter than the download-retry worst case #91, confirmed by its own cleanDOWNLOAD_FAILEDtrace and the SSH test passing later in the same run)🤖 Generated with Claude Code
Summary by CodeRabbit