Summary
Currently, all runners share the same GUI session (user's desktop). For full isolation, each runner should get its own dedicated GUI session.
Current Behavior
When --enable-gui is used, runners can access the display but share the same session:
- Multiple runners can interfere with each other's GUI operations
- Windows from different runners appear on the same desktop
- No true visual isolation
Desired Behavior
Each runner with GUI access should run in a separate GUI session:
- User isolation mode: Use
launchctl bootstrap gui/{uid} to create per-user GUI contexts
- Container isolation: Each container should have its own virtual display
Benefits
- True visual isolation between runners
- Prevents GUI interference (window focus stealing, etc.)
- Better for parallel E2E tests
- Cleaner architecture
Implementation Notes
For user isolation:
# Create GUI session for dedicated user
launchctl bootstrap gui/$(id -u _macrunner) /path/to/plist
For container isolation:
- May need Xvfb or similar virtual display inside containers
- Or use macOS's native per-user GUI sessions if available in containers
References
- Related to headless mode feature (feat/headless-default branch)
- macOS
launchctl GUI sessions: man launchctl
- Xvfb (X Virtual Framebuffer) for Linux containers
Priority
Medium — headless mode addresses the main use case. This is for advanced parallel visual testing scenarios.
Summary
Currently, all runners share the same GUI session (user's desktop). For full isolation, each runner should get its own dedicated GUI session.
Current Behavior
When
--enable-guiis used, runners can access the display but share the same session:Desired Behavior
Each runner with GUI access should run in a separate GUI session:
launchctl bootstrap gui/{uid}to create per-user GUI contextsBenefits
Implementation Notes
For user isolation:
For container isolation:
References
launchctlGUI sessions:man launchctlPriority
Medium — headless mode addresses the main use case. This is for advanced parallel visual testing scenarios.