Skip to content

fix: drive deferred layout explicitly in offscreen portal/overlay tests — un-quarantine on runners#175

Merged
arzafran merged 1 commit into
mainfrom
fix/runner-image-test-regressions
Jul 22, 2026
Merged

fix: drive deferred layout explicitly in offscreen portal/overlay tests — un-quarantine on runners#175
arzafran merged 1 commit into
mainfrom
fix/runner-image-test-regressions

Conversation

@arzafran

Copy link
Copy Markdown
Member

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: call TerminalWindowPortalRegistry.synchronizeForAnchor(anchor) directly after the layout pass, in addition to the existing scheduleExternalGeometrySynchronize call. On CI the deferred hop was landing one drainMainQueue() turn late (first pass saw no frame change; the shift only showed up on the second drain). Both drainMainQueue() calls and the scheduling call 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 mount DispatchWorkItem to run, instead of relying solely on XCTNSPredicateExpectation's implicit run-loop pumping (which timed out completely on CI, not just late).
  • Un-quarantine BrowserWindowPortalLifecycleTests: removed the class-level setUpWithError CI skip added in dda57e17a0. 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

  • Local: xcodebuild -scheme programa-unit -only-testing:programaTests/BrowserWindowPortalLifecycleTests -only-testing:programaTests/TerminalWindowPortalLifecycleTests -only-testing:programaTests/GhosttySurfaceOverlayTests test — all 21 + 2 targeted tests pass
  • CI: tests job green on real runners, including the previously-skipped BrowserWindowPortalLifecycleTests suite

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
arzafran marked this pull request as ready for review July 22, 2026 12:56
@arzafran
arzafran merged commit c17a544 into main Jul 22, 2026
11 of 13 checks passed
@arzafran
arzafran deleted the fix/runner-image-test-regressions branch July 22, 2026 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant