fix(test): harden work.test.ts runKb against CI spawn-timeout flake#34
Conversation
The runKb helper coerced a killed-subprocess (status === null, from the 10s spawnSync timeout or a signal) into exitCode 1, surfacing as the misleading 'expected 1 to be +0' flake in 'clears handoff with --clear' under loaded 2-core CI (issue #25). - Bump the spawn timeout 10s -> 30s (cold node start + module load under cross-file vitest parallelism can exceed 10s). - Retry once on status === null (the kill/timeout signature), then throw a real diagnostic (signal + error) instead of a coerced exit code. - Return result.status directly (no longer null at this point). Closes #25.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe test helper ChangesCLI Test Runner Resilience
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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 |
What
Hardens the
runKbhelper intests/cli/work.test.tsagainst the CI flake tracked in #25.Root cause
runKbranspawnSyncwith a 10s timeout and returnedexitCode: result.status ?? 1. When thenodesubprocess was killed (timeout or signal) under loaded 2-core CI with cross-file vitest parallelism,result.statusisnull→ coerced to1. That surfaced as the misleadingAssertionError: expected 1 to be +0inclears handoff with --clear— a spawn-timing race, not a real exit-1.Change
status === null(the kill/timeout signature).signal+error) instead of a coerced exit code — future failures will be debuggable rather than a bare1.result.statusdirectly (guaranteed non-null at the return).Test-infra only; no production code touched.
Verification
tests/cli/work.test.ts: 55/55 pass.cli-bundle.test.tswas an unrelated stale-artifact: the pre-existing localdist/cli-bundle/cli.jsreported0.2.1vspackage.json0.3.0post-release; rebuilding the bundle →0.3.0, 7/7 pass. CI freshly bundles in a pre-step, so it does not hit this.)eslintclean on the changed file.Closes #25.
Summary by CodeRabbit
Release Notes
Note: This release contains internal testing infrastructure improvements only. No user-facing changes included.