Skip to content

fix: drive split-resize test through explicit layout, un-quarantine on CI (#169)#170

Merged
arzafran merged 3 commits into
mainfrom
fix/169-split-resize-ci
Jul 21, 2026
Merged

fix: drive split-resize test through explicit layout, un-quarantine on CI (#169)#170
arzafran merged 3 commits into
mainfrom
fix/169-split-resize-ci

Conversation

@arzafran

@arzafran arzafran commented Jul 21, 2026

Copy link
Copy Markdown
Member

What this does

The split-resize browser-portal test was quarantined on CI in e78b4bb because it no-op'd on the current runner image. It relied on NSSplitView.didResizeSubviewsNotification to trigger the portal's resync, but that observer defers the actual resync work via DispatchQueue.main.async. On the CI runner that deferred block never drained within the test's advanceAnimations() window, so the portal never resynced after the divider move and the test failed deterministically while passing locally.

Important update since this branch was created

While this fix was in progress, main moved past the single-test skip: dda57e17a0 quarantines the entire BrowserWindowPortalLifecycleTests suite (21 tests) via a class-level setUpWithError skip, after three individual per-test fix attempts each failed the same way on the runner. That commit's message frames it as a broader "never-shown-window layout behavior changed on the runner image" regression (setPosition layout pass and overlay visibility), not confined to this one test's notification-timing issue.

This PR is rebased onto that state. My fix is still correct and verified locally (see test plan), and it's a real, defensible root-cause fix for this specific test's failure mode — but the class-level skip still covers it on CI, since un-quarantining the whole suite is a bigger, runner-side investigation that's out of scope for this change. I did not touch the class-level skip.

Summary

  • Call portal.synchronizeWebViewForAnchor(anchor) directly after the layout pass instead of only posting the notification and waiting on the deferred observer.
  • Exercises the exact same production sync path (WindowBrowserPortal.synchronizeWebView(withId:source:)) synchronously, matching the pattern the sibling testPortalAnchorResizeDoesNotForceHostedWebViewPresentationRefresh test already uses.
  • Doesn't change what the assertions measure: the geometryOnly refresh they check for (displayIfNeeded increments, no reattach) still only fires because the anchor's frame genuinely changed.
  • No production code touched. Class-level CI skip left as-is (out of scope here).

Fixes the notification-timing root cause tracked in #169 for this one test. Does not by itself un-quarantine the suite on CI — that requires the broader runner-side investigation dda57e17a0 flagged as pending.

Test Plan

  • xcodebuild -project GhosttyTabs.xcodeproj -scheme programa-unit -destination 'platform=macOS' -only-testing:programaTests/BrowserWindowPortalLifecycleTests test — all 21 tests pass locally, including this one
  • CI run (watching)

arzafran added 3 commits July 21, 2026 16:21
…n CI

testExternalSplitResizeDoesNotForceHostedWebViewPresentationRefresh relied
on NSSplitView.didResizeSubviewsNotification to trigger the portal's resync,
but that observer defers the actual work via DispatchQueue.main.async
(WindowBrowserPortal.scheduleExternalGeometrySynchronize). On the CI runner
image that deferred block never drains within the test's RunLoop window, so
the portal never resyncs after the divider move and the test no-ops
deterministically (#169).

Call portal.synchronizeWebViewForAnchor(anchor) directly after the layout
pass instead of only posting the notification and waiting on the deferred
observer. This exercises the same production sync path
(WindowBrowserPortal.synchronizeWebView(withId:source:)) synchronously,
matching the pattern the sibling anchor-resize test already uses. It does
not change what the assertions measure: the geometryOnly refresh they check
for still only fires because the anchor's frame genuinely changed.

Delete the CI-only XCTSkipIf added in e78b4bb.
…n CI

testExternalSplitResizeDoesNotForceHostedWebViewPresentationRefresh relied
on NSSplitView.didResizeSubviewsNotification to trigger the portal's resync,
but that observer defers the actual work via DispatchQueue.main.async
(WindowBrowserPortal.scheduleExternalGeometrySynchronize). On the CI runner
image that deferred block never drains within the test's RunLoop window, so
the portal never resyncs after the divider move and the test no-ops
deterministically (#169).

Call portal.synchronizeWebViewForAnchor(anchor) directly after the layout
pass instead of only posting the notification and waiting on the deferred
observer. This exercises the same production sync path
(WindowBrowserPortal.synchronizeWebView(withId:source:)) synchronously,
matching the pattern the sibling anchor-resize test already uses. It does
not change what the assertions measure: the geometryOnly refresh they check
for still only fires because the anchor's frame genuinely changed.

Delete the CI-only XCTSkipIf added in e78b4bb.
@arzafran
arzafran marked this pull request as ready for review July 21, 2026 19:55
@arzafran
arzafran merged commit d4fa1f1 into main Jul 21, 2026
7 of 10 checks passed
@arzafran
arzafran deleted the fix/169-split-resize-ci branch July 21, 2026 19:55
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