Repository navigation
ci: give each virtual display helper its own serial - #14897
Conversation
WindowServer refuses a CGVirtualDisplay whose vendor/product/serial matches a display it still lists, and it can keep a display after the helper that made it exits. On the owned minis (cmux9s, cmux10s, cmux13s) a display created at 11:47 local stayed listed with no helper alive, and every later create with the fixed serial 0x0001 failed with "Display V: 0x1234, P: 0x5678, S: 0x1 already exists!", so tests-build-and-lag failed its display churn setup twice per run. The helper now uses its pid as the serial and tries three more if a leaked display holds that one. reap-strays also matched its own grep in ps, so it reported a stray on every run, waited 5 s and then kill -9'd a pid that had already exited. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
All contributors have signed the CLA ✍️ ✅ |
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughVirtual display creation now tries up to four process-derived serials if initialization fails. Stray-helper detection uses a bracketed grep pattern to avoid matching the grep process itself. ChangesVirtual display helper
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The helper retries display creation and only signals readiness after configuration succeeds. No actionable merge-blocking risk is established. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
🚥 Pre-merge checks | ✅ 25✅ Passed checks (25 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
Merge receipt for |
f77bfdd Show a password input indicator while echo is off (manaflow-ai#14867) ec04960 web tests: spawn client-config-env children asynchronously (manaflow-ai#14899) f10c5ce test: say why the portal fixture's scrollback wait failed (manaflow-ai#14898) 2e6a5ba ci: give each virtual display helper its own serial (manaflow-ai#14897) 208a6bf Keep the unfocused-pane dim in step with focus when a pane is revealed (manaflow-ai#14892) 33b4c92 fix: finish a detach-induced checklist popover close without its animation (manaflow-ai#14895) a3baec3 test: free the remaining hosted test terminals and scope the portal leak check (manaflow-ai#14888)
Problem
tests-build-and-lagfails its display churn setup on owned minis withERROR: Failed to create CGVirtualDisplay(cmux9s 21:38Z, cmux13s 22:08Z and 01:24Z, cmux10s on 09-26).WindowServer's log on cmux9s at the failure:
A display created at 18:47Z (display 5) is still listed by
system_profiler SPDisplaysDataTypeas "CI Virtual Display", and no helper process is alive. WindowServer kept it after its helper exited. The helper always used serial 0x0001, so every later create on that Mac fails until the GUI session restarts. cmux10s, cmux12s and cmux13s show the same leaked display.Fix
scripts/create-virtual-display.m: the serial is the helper's pid (low 24 bits). If a leaked display already holds it, the helper tries three more serials (attempt number in the top byte).scripts/ci/virtual-display-lock.sh:stray_helper_pidsgrepped forcreate-virtual-displayand matched its own grep inps. Every run printed "Reaping stray virtual-display helpers", waited 5 s, thenkill -9'd a pid that had already exited. The pattern is now[c]reate-virtual-display.The lag test passes the display id to the app, and nothing matches on the serial, so a new serial per run changes nothing else.
Tests
tests/test_ci_virtual_display_lock.shpasses.clangline CI uses. It was not run on a mini, because creating a display there would disturb a GUI job running on that Mac.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes the display churn setup in
tests-build-and-lagfailing on owned minis when WindowServer still lists a display whose helper process has exited.WindowServer refuses a
CGVirtualDisplaywhose vendor/product/serial matches one it still lists, and it can keep a display after its helper exits, so the fixed serial0x0001blocked every later create until the GUI session restarted. The helper now uses its pid as the serial and tries three more values if a leaked display holds that one.virtual-display-lock.shalso stopped matching its own grep inps, which madereap_strayswait 5 s and kill a pid that had already exited.Written for commit 2b6fc3b. Summary will update on new commits.
Summary by CodeRabbit