fix: drive deferred layout explicitly in offscreen portal/overlay tests — un-quarantine on runners#175
Merged
Merged
Conversation
The 2026-07-21 GitHub macOS runner image changed layout/dispatch timing for offscreen test windows: DispatchQueue.main.async work that landed within a single drainMainQueue()/RunLoop turn on a dev machine can now land a turn late, or (for GhosttySurfaceOverlayTests) not observably land within XCTNSPredicateExpectation's polling window at all. - TerminalWindowPortalLifecycleTests.testDragDrivenSidebarResizeDoesNotScheduleLateSecondTerminalResize: drive the anchor resync through TerminalWindowPortalRegistry.synchronizeForAnchor directly, in addition to the existing scheduleExternalGeometrySynchronize call, matching the pattern already proven in PR #170 for the browser portal. The scheduling call and both drainMainQueue() calls stay, so the test still verifies the deferred path doesn't double-apply a shift. - GhosttySurfaceOverlayTests.testSearchOverlayFocusesSearchFieldAfterDeferredAttach: add an explicit drainMainQueue() call right after setSearchOverlay to force the already-scheduled DispatchWorkItem mount closure to run, instead of relying solely on XCTNSPredicateExpectation's implicit run-loop pumping to observe it. - Un-quarantine BrowserWindowPortalLifecycleTests (#169): the class-level CI skip is no longer needed now that the one root-caused test in the suite drives its resync explicitly. All 21 tests in the suite pass locally with the skip removed.
arzafran
marked this pull request as ready for review
July 22, 2026 12:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
GitHub's macOS runner image changed on 2026-07-21, breaking timing assumptions in a handful of tests that use offscreen/never-shown windows: deferred main-queue work that used to land within one drain/RunLoop turn on a dev machine now sometimes lands a turn late, or doesn't get observed within a polling window at all. PR #170 already root-caused and fixed one such test; this PR applies the same "drive the deferred path explicitly" pattern to the other two failures called out in #169, and removes the suite-level CI skip that was masking the rest of
BrowserWindowPortalLifecycleTests.Summary
TerminalWindowPortalLifecycleTests.testDragDrivenSidebarResizeDoesNotScheduleLateSecondTerminalResize: callTerminalWindowPortalRegistry.synchronizeForAnchor(anchor)directly after the layout pass, in addition to the existingscheduleExternalGeometrySynchronizecall. On CI the deferred hop was landing onedrainMainQueue()turn late (first pass saw no frame change; the shift only showed up on the second drain). BothdrainMainQueue()calls and the scheduling call stay, so the test still verifies the deferred path doesn't double-apply a shift.GhosttySurfaceOverlayTests.testSearchOverlayFocusesSearchFieldAfterDeferredAttach: add an explicitdrainMainQueue()call right aftersetSearchOverlayto force the already-scheduled mountDispatchWorkItemto run, instead of relying solely onXCTNSPredicateExpectation's implicit run-loop pumping (which timed out completely on CI, not just late).BrowserWindowPortalLifecycleTests: removed the class-levelsetUpWithErrorCI skip added indda57e17a0. It was only needed because of the one test PR fix: drive split-resize test through explicit layout, un-quarantine on CI (#169) #170 fixed; all 21 tests in the suite pass locally with the skip removed.References #169.
Test Plan
xcodebuild -scheme programa-unit -only-testing:programaTests/BrowserWindowPortalLifecycleTests -only-testing:programaTests/TerminalWindowPortalLifecycleTests -only-testing:programaTests/GhosttySurfaceOverlayTests test— all 21 + 2 targeted tests passtestsjob green on real runners, including the previously-skippedBrowserWindowPortalLifecycleTestssuite