Repository navigation
test(wsl): drive hook-relay reattach bench through real PTY spawn - #13260
Conversation
Follow-up to #13139: stop calling ensureWslHookRelayForReattach from the benchmark and instead reattach a surviving WSL PTY via main's registerPtyHandlers path, so a missing or misplaced integration in pty.ts fails the bench.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe benchmark now loads production PTY and relay modules through Jiti with disposable Electron and runtime stubs. It spawns a surviving WSL PTY through the production path, verifies PTY ID reuse, and checks for exactly one relay refresh. The JSON output includes the reattached PTY ID and refreshed distros. Cleanup kills all PTYs and removes temporary user data. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 99d1e6cb-6876-4770-9f23-8914842138b2
📒 Files selected for processing (2)
config/scripts/wsl-hook-relay-reattach-benchmark-electron-stub.mjsconfig/scripts/wsl-hook-relay-reattach-benchmark.mjs
- Wrap benchmark in try-finally for reliable cleanup - Add jiti module graph duplication detection to catch missing pty.ts integration - Track relay refreshes only during reattach phase to avoid false positives from earlier phases - Disable agent-status hooks during PTY spawn (reattach path doesn't gate on them) - Improve error messages and make cleanup safe with optional chaining
…ablyai#13260) * test(wsl): drive hook-relay reattach bench through real PTY spawn Follow-up to stablyai#13139: stop calling ensureWslHookRelayForReattach from the benchmark and instead reattach a surviving WSL PTY via main's registerPtyHandlers path, so a missing or misplaced integration in pty.ts fails the bench. * refactor(bench): isolate reattach relay refresh measurement and verify s - Wrap benchmark in try-finally for reliable cleanup - Add jiti module graph duplication detection to catch missing pty.ts integration - Track relay refreshes only during reattach phase to avoid false positives from earlier phases - Disable agent-status hooks during PTY spawn (reattach path doesn't gate on them) - Improve error messages and make cleanup safe with optional chaining
Summary
Follow-up to #13139 / CodeRabbit feedback: harden
bench:wsl-hook-relay-reattachso it fails if the production integration insrc/main/ipc/pty.tsis removed or miswired.ensureWslHookRelayForReattachdirectly from the benchmarkregisterPtyHandlerspath under plain Node via a minimalelectronstubptyController.spawnWhy
The #13139 bench could pass with only the helper + manager working. That missed the failure mode the product fix actually needed: the reattach call site in the PTY spawn path.
Test plan
node --checkon both benchmark scripts--distro Ubuntu --samples 20):[]✅stalledConnections: 21then clean 20/20 after refreshRun (Windows host only; guest Node ≥18 + python3):