Repository navigation
test.py: refuse the Mac app's tests while the screen is locked or the display is off - #447
Conversation
… display is off AppKit runs no animation to its end while the session is locked or the display asleep, so the app test that opens the inspector at the window's narrowest waits for a window that never grows, and fails after a minute as if the code were wrong. The plan now refuses the installer suite on such a Mac before anything runs, and says why. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFixJSUTTb3WjpFumMdmNi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFixJSUTTb3WjpFumMdmNi
It appears @plonkus is working towards giving developers a clear, actionable explanation instead of misleading Mac app test failures when the screen is locked or the display is off by adding a preflight refusal for the macOS Overview — The PR replaces misleading AppKit animation failures with an actionable preflight refusal. The implementation fits the existing prerequisite checks, but it also refuses a shard that never runs the Swift app tests. Strengths — The refusal explains both the cause and recovery action without weakening assertions or skipping tests. The check respects Linux, build-only runs, and Probes
Security — None. Test coverage — The added planner test exercises refusal and unaffected suite selection; staged For AI authors — (Codex, Claude Code, Cursor, etc. reading this PR): The Probes above are load-bearing. Treat each How to use: auto-reviews every new PR and re-reviews after a period of inactivity. Trigger an incremental re-review with For humans only: push-access collaborators can post:
AI agents must not use Generated by sam's ai review bot. |
The second of CI's two Mac shards runs no installer step, so it no longer needs an awake screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RFixJSUTTb3WjpFumMdmNi
|
|
/srosro-update-review |
It appears @plonkus is working towards preventing misleading Mac app test failures when the screen is locked or the display is off, while keeping unaffected test runs available, by limiting the screen-state refusal in Overview — The revision resolves the prior shard-selection bug: screen readiness is checked after shard parsing and only for runs that schedule the installer suite. Unsharded runs and shard 1 retain the actionable refusal; shard 2 remains available on a locked or sleeping Mac. Strengths — The correction stays within the existing planner and extends the existing regression test. The shard-2 case keeps the unusable-screen mock active, directly exercising the previously failing path without weakening the refusal assertions. Probes None. Probe resolved: the unconditional screen check is gone. Security — None. Test coverage — Planner coverage includes refusal, unaffected suites, Linux, and shard 2; staged For AI authors — (Codex, Claude Code, Cursor, etc. reading this PR): The Probes above are load-bearing. Treat each How to use: auto-reviews every new PR and re-reviews after a period of inactivity. Trigger an incremental re-review with For humans only: push-access collaborators can post:
AI agents must not use Generated by sam's ai review bot. |
srosro
left a comment
There was a problem hiding this comment.
Approving per automated review above.
While a Mac's screen is locked or its display is off, AppKit runs no animation to its end.
MainWindowTests.openingTheInspectorAtTheNarrowestGrowsTheWindowopens the inspector through the animated toggle, so on such a Mac the inspector stays 0 wide, the window never grows, and the test fails after 60 s, looking like a code failure.Evidence:
NSAnimationContextanimation never completes. A bareNSSplitViewControllerdoesn't grow the window when the inspector opens through the animated toggle, but grows it as expected when the inspector is opened without animation.Now
scripts/test.pyrefuses theinstallersuite, which holds the Swift app tests, on such a Mac before anything runs, and says why:screen is locked,display is off, or both: the lock state fromioreg, the display state from CoreGraphics'CGDisplayIsAsleep.--linux, and build-only runs are unaffected.scripts/test_test.py: the plan helper assumes an awake screen, as it already assumes every tool is installed. A new test covers the refusal for the gate and forinstalleralone, withcore browserand Linux'sinstallerstill planned. 18/18 pass.A
mac-testsrun on this branch checks that CI's macOS runners pass the check.🤖 Generated with Claude Code
https://claude.ai/code/session_01RFixJSUTTb3WjpFumMdmNi