Skip to content

ci(ios): Run iOS runtime tests on the build image - #24680

Closed
MartinZikmund wants to merge 8 commits into
masterfrom
dev/mazi/ci-ios-image
Closed

MartinZikmund wants to merge 8 commits into
masterfrom
dev/mazi/ci-ios-image

Conversation

@MartinZikmund

@MartinZikmund MartinZikmund commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

GitHub Issue: closes #24679

Part of #24959.

PR Type:

🏗️ Build or CI related changes

What changed? 🚀

The Tests - iOS Skia shards spent a median 6.1 min (max 15.7) of every ~24 min shard installing idb (Homebrew tap + idb-companion + pipx fb-idb), only to install the app with it. The simulator boot was already finished by the time idb was ready. They also ran on macOS-14 / Xcode 15.3, and macOS 14 images are unsupported on Azure DevOps from 2026-11-02.

  • The iOS test shards now run on the build image and Xcode (macOSVMImage / xCodeRoot: macOS-26, Xcode 26.6). Only the iOS stage changes; tvOS, macOS desktop and TestFlight still use macOSVMImage_UITests.

  • ios-uitest-run.sh uses the simulator runtime that ships with the selected Xcode instead of a hardcoded iOS-17-5. It creates iPad Pro (12.9-inch) (6th generation) when the image doesn't pre-create it (macOS 26 only ships M4/M5 iPads), so the screen size stays the same.

  • The app is installed with xcrun simctl install (one retry), as the tvOS runner already does. idb is removed.

  • Framework fix (iOS): on the iOS 26.5 simulator the shards froze after their first multi-window runtime test. Destroying a secondary window's scene while it was in front, or on its way there, left the app with no foreground scene. Full-screen iPadOS 26 then sends the app to the home screen and suspends it, so the results file never appears (device log: running-active → running-suspended). Two paths did it:

    • closing a secondary window whose scene was in front (NativeWindowWrapper.CloseCore);
    • closing a window before its scene connected: the late scene then had no window, and UnoUISceneDelegate discarded it while SpringBoard was already bringing it forward (No window is awaiting a scene … discarding the session, followed by OnSuspending).

    Both now go through UnoUISceneDelegate.DestroyScene, which brings another scene forward unless the destroyed one is in the background. When tests open and close windows in quick succession, the transitions overlap, and a later one can override that request. So the delegate never picks a scene it is destroying itself, and once a destroyed scene (one that wasn't in the background) has actually disconnected, it activates a remaining scene if nothing is in the foreground. Before that, one shard ran ~4.5 minutes with the main window hidden. Real apps on iPadOS 26 hit the same thing, so this is a user-facing fix, not just a CI one. Covered by Given_Window.When_Secondary_Window_Closed_Then_Initial_Window_Visible and When_Secondary_Window_Closed_Before_Shown_Then_Initial_Window_Visible.

Baseline (40 successful master/PR shards, 2026-09-25): shard job median 24.0 min. Run iOS Simulator Tests median 17 min, of which 6.1 min idb, 9.1 min tests, and 0 failed tests across all 4 shards (~2162/1743/2785/2433 results).

Risk: the simulator runtime moves from iOS 17.5 to iOS 26.x, so runtime test outcomes can shift. This PR's CI run is the check for that.

PR Checklist ✅

🤖 Generated with Claude Code

https://claude.ai/code/session_017v4y4kv5NebzLmrQoV5Yny

@github-actions github-actions Bot added the area/build Categorizes an issue or PR as relevant to build infrastructure label Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 3m 22s —— View job


Review complete ✅

Todo list

  • Gather context (PR description, diff, custom instructions)
  • Read changed files in full
  • Review .azure-devops-tests-skia-stages.yml changes
  • Review ios-uitest-run.sh changes (script correctness, error handling, retry logic)
  • Post inline comments for findings
  • Post summary

Verdict: ship (one low-severity, non-blocking finding)

Findings by severity: 1 low/plausible.

Scope check: The pipeline change only rewires the runtime_tests_skia_ios stage's second job invocation (vmMacImageTest → vmMacImage, xCodeRootTest → xCodeRootBuild); I traced vmMacImageTest/xCodeRootTest through .azure-devops-tests-ios-skia-build.yml and confirmed that template never actually consumes them, so the build job and every other stage (tvOS, macOS, Linux, Windows, TestFlight) are untouched, matching the stated "only the iOS stage changes."

Script review: The idb removal and the switch to Xcode-native simulator-runtime resolution are a clean, well-justified simplification — the retained inline history comments accurately explain why the old approach existed before removing it, and the new device-creation/boot-watchdog/install-retry logic reads correctly under set -euo pipefail (retry failures still propagate to the existing harness-crash trap/re-run mechanism instead of being silently swallowed).

Cross-cutting note (non-blocking): The runtime-resolution race flagged inline is theoretical under today's one-runtime-per-Xcode assumption; the PR's own baseline data and the "this PR's CI run is the check" approach for the iOS 17.5→26.x runtime jump is the right way to validate the real risk here (test outcome drift), which isn't something static review can assess.
· branch

Comment thread build/test-scripts/ios-uitest-run.sh Resolved
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 43s —— View job


Review complete ✅

Todo list

  • Gather context (PR description, diff, custom instructions)
  • Read changed files in full
  • Review .azure-devops-tests-skia-stages.yml changes
  • Review ios-uitest-run.sh changes (script correctness, error handling, retry logic)
  • Post inline comments for findings
  • Post summary

Verdict: ship (one low-severity, non-blocking finding)

Findings by severity: 1 low.

What changed since the last review: this synchronize added one commit (2f8bff4c) that fixes exactly the non-deterministic-runtime-selection issue flagged previously — the jq pipeline now does sort_by(.version | split(".") | map(tonumber? // 0)) before taking .[-1], so runtime selection is a real version-max instead of "last in whatever order simctl/jq happens to return." Confirmed via git diff between the previously-reviewed commit and HEAD that this is the only change in scope.

Cross-cutting notes (non-blocking):

  • The .azure-devops-tests-skia-stages.yml edit stays scoped to the runtime_tests_skia_ios stage's test-job parameters (vmMacImageTest → build image, xCodeRootTest → build Xcode); the build job and every other stage (tvOS, macOS, Linux, Windows, TestFlight) are untouched, matching the PR description.
  • The idb removal is clean — grep -i idb over the script only turns up the two explanatory comment lines; no dangling IDB_AVAILABLE/PATH references were left behind.
  • The new simctl install retry (one retry after a 10s sleep, no || true) correctly propagates a second failure under set -euo pipefail, matching the tvOS runner's existing pattern as described.
  • The iOS 17.5 → 26.x simulator-runtime jump is a real behavioral risk, but it's a test-outcome question this PR's own CI run is positioned to answer, not something static review can assess.
    · branch

Comment thread build/test-scripts/ios-uitest-run.sh Resolved
@unodevops

Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 236909 has failed on Uno.UI - CI.

MartinZikmund and others added 2 commits October 3, 2026 10:53
The iOS test shards ran on macOS 14 with Xcode 15.3 and spent ~6 minutes
of each ~24 minute shard installing idb from Homebrew and PyPI, only to
install the app with it. macOS 14 images are also unsupported on Azure
DevOps from 2026-11-02.

Run the shards on the build image and Xcode, pick the simulator runtime
that ships with that Xcode, create the iPad device when the image has
none, and install the app with `xcrun simctl install`, as tvOS does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017v4y4kv5NebzLmrQoV5Yny
MartinZikmund and others added 2 commits October 3, 2026 11:34
On full-screen iPadOS 26, destroying the scene of a secondary window that is in front leaves the app with no foreground scene, so it lands on the home screen and gets suspended. This froze every iOS runtime test shard on the iOS 26.5 simulator after the first multi-window test.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018riLfyvT4wZYEh8iFjWkKa
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 57s —— View job


Review complete ✅

Todo list

  • Gather context (PR description, diff, custom instructions)
  • Identify what's new since the last review (synchronize event)
  • Read changed files in full
  • Review CI script changes (already reviewed twice — no new changes since last review)
  • Review AppleUIKitWindowWrapper.cs (new file in scope)
  • Review Given_Window.cs runtime test (new file in scope)
  • Post inline comments for findings
  • Post summary

Verdict: ship (one low-severity, non-blocking finding)

Findings by severity: 1 low.

What changed since the last review: this synchronize added two new commits not previously reviewed — e7343018 (fix(ios): Bring a remaining scene forward when closing the front window) and 34e3ea97 (test(ios): Initial window stays visible after closing a secondary one). The two CI-script commits (30ee2fa3, 9523a88a) were already reviewed twice before and are unchanged since.

Root-cause assessment: this is a genuine root-cause fix, not a guard. The broken invariant is "a full-screen iPadOS app must always have one foreground scene" — CloseCore previously destroyed a foreground secondary window's scene without activating another one first, leaving the app with no foreground scene, which iPadOS 26 suspends (this is what froze every iOS shard after the first multi-window test on the new image). The fix activates a remaining scene before requesting destruction of the closing one, only when the closing scene was actually foreground (ForegroundActive/ForegroundInactive), so it's correctly scoped rather than unconditional.

Test coverage: When_Secondary_Window_Closed_Then_Initial_Window_Visible is a correct red/green regression test — it activates a secondary window, closes it, and asserts the initial window becomes visible again (would time out pre-fix on an iPadOS 26 scene-exclusive environment). It's unguarded by [PlatformCondition], which is fine: the invariant it asserts is a reasonable one to hold on every multi-window platform, it just happens to be non-iOS-specific scenes that make it trivially true elsewhere.

Inline finding (non-blocking): ActivateOtherScene activates whichever scene ConnectedScenes enumerates first rather than deterministically preferring Window.InitialWindow's own scene — fine for the 2-window regression scenario, but with 3+ open windows it could bring forward an arbitrary secondary window instead of the main one.

Validation: code-review only — no Mac/iOS toolchain available in this environment to compile or run the runtime test. The PR description already states its own CI run is the intended validation for the iOS 17.5 → 26.x runtime-behavior risk.
· branch

@MartinZikmund
MartinZikmund marked this pull request as ready for review October 3, 2026 09:58
Copilot AI balanced review requested due to automatic review settings October 3, 2026 09:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Updates iOS CI/runtime testing to run on the build macOS image + selected Xcode runtime (removing idb), and fixes an iPadOS 26 multi-window foreground activation regression that could suspend the app after closing a secondary window.

Changes:

  • Move iOS Skia test shards to build macOS/Xcode configuration and remove idb-based install path.
  • Update iOS UI test runner script to auto-select the simulator runtime shipped with the chosen Xcode and create the expected iPad device when missing.
  • Fix iOS scene closing behavior to activate another scene before destroying the foreground scene; add a runtime test covering the scenario.
File Description
src/​Uno.UI.RuntimeTests/​Microsoft/​UI/​Xaml/​Given_Window.cs Adds a runtime test for multi-window close/visibility behavior on iOS.
src/​Uno.UI.Runtime.Skia.AppleUIKit/​UI/​Xaml/​Window/​AppleUIKitWindowWrapper.cs Activates another UIWindowScene before destroying the active one; adds warning logging on activation failure.
build/​test-scripts/​ios-uitest-run.sh Removes idb installation, auto-resolves simulator runtime/device, and installs via simctl with retry.
build/​ci/​tests/​.azure-devops-tests-skia-stages.yml Runs iOS test shards on the build macOS image/Xcode instead of the retiring macOS 14 test image.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot added platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia labels Oct 3, 2026
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 3m 31s —— View job


Review complete ✅

Todo list

  • Gather context (PR description, diff, custom instructions)
  • Read changed files in full
  • Review .azure-devops-tests-skia-stages.yml changes
  • Review ios-uitest-run.sh changes (incl. fix for previously flagged runtime-sort issue)
  • Review AppleUIKitWindowWrapper.cs + Given_Window.cs (new in this sync)
  • Post inline comments for findings
  • Post summary

Verdict: ship (one low-severity finding, non-blocking but worth fixing before merge)

Findings by severity: 1 low (posted inline on AppleUIKitWindowWrapper.cs:220).

What's new since the last review: this synchronize added two commits beyond the CI/script work already reviewed twice — e7343018 (fix(ios): Bring a remaining scene forward when closing the front window) and 34e3ea97 (test(ios): Initial window stays visible after closing a secondary one). The CI pipeline/script files (.azure-devops-tests-skia-stages.yml, ios-uitest-run.sh) are unchanged since the prior round, where the runtime-selection sort fix (2f8bff4c) was already confirmed.

Scope check: CloseCore now brings another connected scene forward before destroying the one being closed, only when the closing scene is actually foregrounded (ForegroundActive/ForegroundInactive) — correctly scoped to the iPadOS single-foreground-scene constraint described in the inline comment.

Test coverage: When_Secondary_Window_Closed_Then_Initial_Window_Visible is a real regression test, not a trivial no-op — it rides the actual OnSceneEnteredForeground/OnSceneEnteredBackground → IsVisible plumbing, so it fails before the fix (initial window's scene never gets reactivated, stays backgrounded) and passes after. Placement/attributes ([RunsOnUIThread], no [RequiresFullWindow] since it doesn't set window content, no AssertIsFullFledgedApp()) match the file's existing When_Secondary_Window_* conventions.

Cross-cutting note (non-blocking, carried from the previous review round): the UNOBLD008 code is still reused for two distinct failure conditions in ios-uitest-run.sh (missing simulator runtime at line 188 vs. missing device type at line 213); the author hasn't addressed this yet, and it remains low severity/non-blocking.
· branch

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 1m 7s —— View job


Review complete ✅

Todo list

  • Gather context (PR description, diff, prior review comments)
  • Confirm HEAD (34e3ea97) vs. last-reviewed state
  • Re-read all 4 changed files in full against AGENTS.md
  • Check status of previously flagged findings
  • Post summary

Verdict: ship

What's new since the last review: nothing — HEAD is still 34e3ea97, the same commit the previous review (2026-10-03 09:49) already covered in full. No inline comments were re-posted since the code is byte-for-byte unchanged and doing so would just duplicate the existing threads on the same lines.

Outstanding (both already filed as inline comments on this PR, still unaddressed, both non-blocking):

  • build/test-scripts/ios-uitest-run.sh:213 — the "no matching simulator device type" failure logs UNOBLD008, the same code already used for "no matching simulator runtime" at line 188. UNOBLD009 is free (the idb path that used it was removed in this PR) and would keep each failure greppable by a unique code.
  • src/Uno.UI.Runtime.Skia.AppleUIKit/UI/Xaml/Window/AppleUIKitWindowWrapper.cs:231 (ActivateOtherScene) — activates the first UIWindowScene ConnectedScenes enumerates rather than preferring Window.InitialWindow's own scene. Correct for the 2-window regression scenario this PR tests, but with 3+ open windows it could bring forward an arbitrary secondary window instead of the main one.

Confirmed fixed from earlier rounds: the non-deterministic runtime-version selection (startswith + .[-1] without sorting) was fixed in 2f8bff4c with an explicit sort_by(.version | split(".") | map(tonumber? // 0)) before taking the last match.

Cross-cutting notes:

  • Scope stays exactly as described: only the runtime_tests_skia_ios stage's test-job parameters change (vmMacImageTest/xCodeRootTest now point at the build image/Xcode); tvOS, macOS desktop, Linux, Windows and TestFlight stages are untouched.
  • CloseCore's fix is root-cause, not a guard: it activates a remaining scene before requesting destruction of the closing one, scoped to the case where the closing scene was actually foreground (ForegroundActive/ForegroundInactive) — matches the stated invariant ("a full-screen iPadOS app must always have one foreground scene").
  • When_Secondary_Window_Closed_Then_Initial_Window_Visible is a correct red/green regression test for that invariant; no [PlatformCondition] needed since the assertion is reasonably true on every multi-window platform.
  • The iOS 17.5 → 26.x simulator-runtime jump remains a real behavioral-drift risk that only this PR's own CI run can validate — not something static review can assess.
    · branch

A window closed before its scene connects leaves that scene unclaimed, and the scene delegate discards it. On full-screen iPadOS 26 the scene is already on its way to the front, so the discard left the app with no foreground scene and it was suspended, freezing three of the four iOS runtime-test shards. Both destruction paths now go through UnoUISceneDelegate.DestroyScene, which brings another scene forward unless the destroyed one is in the background.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018riLfyvT4wZYEh8iFjWkKa
Copilot AI balanced review requested due to automatic review settings October 3, 2026 17:47
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 55s —— View job


Review complete ✅

Todo list

  • Gather context (PR description, diff, prior review comments)
  • Identify what's new since the last review (HEAD moved from 34e3ea97 to 55d01712)
  • Read changed files in full, including new UnoUISceneDelegate.cs
  • Check status of previously flagged findings
  • Post inline comments for new findings
  • Post summary

Verdict: ship (3 low-severity findings, all non-blocking)

Findings by severity: 3 low.

What's new since the last review: this synchronize added two commits not previously reviewed — 9dfdbf5a (fix(ios): Keep a foreground scene when discarding an unclaimed one) and 55d01712 (test(ios): Initial window stays visible after closing an unshown secondary one). The CI pipeline/script files and the earlier CloseCore/ActivateOtherScene fix (e7343018/34e3ea97) are unchanged since the last round and were already reviewed twice.

Root-cause assessment of the new commit: this is a second, related root-cause fix, not a patch over the first one. The first fix (e7343018) only covered a scene that was already connected and in front. This one covers the remaining gap: a window closed before its requested scene finishes connecting leaves that scene to be discarded later in WillConnect's "no window is awaiting a scene" branch — and a still-connecting (Unattached) scene is already on its way to becoming the foreground scene on full-screen iPadOS, so discarding it unconditionally hit the same no-foreground-scene suspension. Both destruction paths (WillConnect's discard branch and CloseCore) now funnel through the new UnoUISceneDelegate.DestroyScene, which activates another connected scene first unless the one being destroyed is already Background. Scoping on != Background (rather than only ForegroundActive/ForegroundInactive as before) correctly extends the invariant to the Unattached case this commit targets.

Test coverage: When_Secondary_Window_Closed_Before_Shown_Then_Initial_Window_Visible is a genuine new scenario (activate-then-immediately-close, before the scene connects), distinct from the earlier When_Secondary_Window_Closed_Then_Initial_Window_Visible.

New inline findings (all low, non-blocking):

  • UnoUISceneDelegate.cs:126 — the deprecated RequestSceneSessionActivation overload is still called unconditionally with no #pragma/OS-version branch, now at its new location after moving out of AppleUIKitWindowWrapper.cs; likely a new CA1422 warning on CI since the project doesn't suppress it project-wide. This is the same substance as a finding from an earlier round that was never addressed, just relocated.
  • AppleUIKitWindowWrapper.cs:194 — the CloseCore guard dropped the Session: { } session non-null check it had before this commit; DestroyScene now passes scene.Session to the destruction API unchecked. Likely harmless in practice (a connected scene should always have a session) but worth a sanity check.
  • Given_Window.cs:142 — new test uses a fixed Task.Delay(2s) rather than a bounded poll; there's precedent for this pattern elsewhere in the file, so it's a nit rather than a blocker, but notable given this PR's own goal of trimming slow/flaky iOS CI steps.

Outstanding from earlier rounds (unchanged, still non-blocking):

  • ios-uitest-run.sh:213 reuses UNOBLD008 for a second, distinct failure condition (UNOBLD009 is free since idb removal).
  • ActivateOtherScene still activates the first ConnectedScenes match rather than deterministically preferring Window.InitialWindow's own scene — fine for today's regression scenarios, could matter with 3+ open windows.

Confirmed fixed from earlier rounds: non-deterministic simulator-runtime selection (2f8bff4c, explicit version sort before taking the last match).

The iOS 17.5 → 26.x simulator-runtime jump remains a real behavioral-drift risk that only this PR's own CI run can validate — not something static review can assess.
· branch

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Scene activation compatibility, app installation ordering, and deterministic regression coverage must be corrected.

Review effort: Balanced
Findings: 2 High severity · 2 Medium severity

Open (4)
Resolved since last review (1)

Comment thread build/test-scripts/ios-uitest-run.sh Resolved
MartinZikmund and others added 2 commits October 3, 2026 20:47
Overlapping scene requests (a test opening and closing windows in quick succession) could leave the initial window hidden for minutes: the activation picked another scene that was itself being destroyed, or a later transition overrode it. Skip scenes the app is destroying, and once a scene that was not in the background disconnects, activate a remaining one if none is in the foreground.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018riLfyvT4wZYEh8iFjWkKa
Scene transitions on the CI simulator take seconds, beyond WaitFor's 1s default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018riLfyvT4wZYEh8iFjWkKa
Copilot AI balanced review requested due to automatic review settings October 3, 2026 18:48
@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 2m 41s —— View job


Review complete ✅

Todo list

  • Gather context (PR description, diff, prior review comments)
  • Identify what's new since the last review round
  • Read changed files in full against AGENTS.md
  • Check status of previously flagged findings
  • Post inline comments for new findings
  • Post summary

Verdict: ship (one new low-severity finding, non-blocking)

Findings by severity: 1 new low (posted inline on UnoUISceneDelegate.cs:42).

What's new since the last review: HEAD moved from 55d01712 to dbab698c, adding two commits: e639a072 (fix(ios): Hand the foreground over once a destroyed scene is gone) and dbab698c (test(ios): Give the scene hand-over time in the window tests). Both are a direct response to the two Uno.UI - CI build failures reported on this PR (#235652, #236909) — i.e. real failures surfaced by the actual iOS 26 simulator run this PR's own CI is meant to validate, not speculative hardening.

Root-cause assessment of e639a072: this closes a real gap left by the earlier DestroyScene/ActivateOtherScene fix — overlapping scene requests (opening and closing windows in quick succession) could pick a replacement scene that was itself mid-destruction, or have the activation overridden by a competing transition, leaving the app foregroundless for minutes. The fix now tracks sessions the app asked UIKit to destroy (_destroyedSessions) and the subset that needed a foreground handoff (_foregroundHandoffs), excludes destroying sessions from being picked as the replacement, and re-checks for a foreground scene once a handed-off session actually disconnects (DidDisconnect, lines 170-178) rather than relying solely on the single activation request made at destroy time. This is a legitimate root-cause fix for a race, not a guard bolted onto a symptom.

New inline finding (low, non-blocking): the fix introduces static, persistent state (_destroyedSessions/_foregroundHandoffs) keyed by UISceneSession.PersistentIdentifier, where previous rounds' logic was stateless per call. The pairing depends on every DestroyScene always reaching a matching DidDisconnect to clear the id; since persistent identifiers can be reused across a scene's reconnect/relaunch lifecycle, a missed DidDisconnect in some edge case would permanently blacklist that session from future activation consideration — reintroducing the same class of bug via a different path. Flagged for a defensive bound, not a blocker.

dbab698c: raises WaitFor's timeout to 15s on both new regression tests to match real CI scene-transition latency (previously flagged as a risk — WaitFor's 1s default was clearly too tight for this). It does not remove the fixed Task.Delay(2s) in When_Secondary_Window_Closed_Before_Shown_Then_Initial_Window_Visible that was already flagged as a non-blocking nit in the prior round — still outstanding, still low severity.

Outstanding from earlier rounds (unchanged, all still non-blocking):

  • ios-uitest-run.sh:213 reuses UNOBLD008 for a second, distinct failure condition (UNOBLD009 is free since idb removal).
  • ActivateRemainingScene/HasForegroundScene don't restrict candidate scenes to the same session role as the one being destroyed/checked (flagged by Copilot on the prior commit); still applies to the renamed methods.
  • The deprecated RequestSceneSessionActivation overload is still called unconditionally with no OS-version branch/#pragma warning disable CA1422, unlike the guarded pattern in NativeWindowFactoryExtension.RequestScene in the same project — flagged twice now, still unaddressed.
  • CloseCore's guard (AppleUIKitWindowWrapper.cs:194) still dropped the non-null Session check that existed before this PR's changes.

Confirmed fixed from earlier rounds: non-deterministic simulator-runtime selection (2f8bff4c, explicit version sort), the ios-uitest-run.sh/.azure-devops-tests-skia-stages.yml scope (unchanged, still limited to the runtime_tests_skia_ios stage).

Validation: code-review only — no Mac/iOS toolchain available in this environment to compile or run the runtime tests. The real validation for both the simulator-runtime jump and this race-condition fix is this PR's own CI run against the iOS 26 image, which is already in progress per the linked build failures/reruns.
· branch

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Installation ordering, lifecycle cleanup, API compatibility, and test synchronization issues remain.

Review effort: Balanced
Findings: 4 High severity · 2 Medium severity

Open (6)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Synchronize test with scene discard completion

src/​Uno.UI.RuntimeTests/​Microsoft/​UI/​Xaml/​Given_Window.cs:142

This fixed delay does not establish that the late scene has connected and disconnected—the transition this regression test is meant to exercise. On a slower shard the initial window can still be visible after two seconds, so WaitFor returns immediately and the regression occurs only after the test has passed. Synchronize on an observable scene-discard completion (for example, a test hook/event) before asserting visibility.

Low severity Add GitHubWorkItem metadata to regression test

src/​Uno.UI.RuntimeTests/​Microsoft/​UI/​Xaml/​Given_Window.cs:109

This regression test is tied to the issue addressed by the PR but lacks the repository-required traceability metadata. .claude/rules/runtime-tests.md:20 requires issue-covering runtime tests to carry GitHubWorkItem; add the associated issue URL.

This issue also appears on line 128 of the same file.

@unodevops

Copy link
Copy Markdown
Contributor

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 237288 found UI Test snapshots differences: skia-linux-screenshots: 119, skia-windows-screenshots: 142

Details
  • skia-linux-screenshots: 119 changed over 2454

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • CompositionEffectBrush.png-dark
    • CompositionEffectBrush.png
    • Buttons.png-dark
    • Buttons.png
    • CalendarView_Theming.png-dark
    • DisplayInformation.png-dark
    • DynamicFont.png-dark
    • DynamicFont.png
    • Focus_FocusVisual_Properties.png-dark
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • ImageIconPage.png-dark
    • ImageIconPage.png
    • Examples.png
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • ExpanderColorValidationPage.png-dark
    • ExpanderColorValidationPage.png
  • skia-windows-screenshots: 142 changed over 2456

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • CalendarView_Theming.png-dark
    • Buttons.png-dark
    • Buttons.png
    • ButtonClippingTestsControl.png-dark
    • ButtonClippingTestsControl.png
    • ClipboardTests.png-dark
    • ClipboardTests.png
    • DisplayInformation.png-dark
    • ElementLevelTheme.png-dark
    • ElementLevelTheme.png
    • Examples.png
    • Gamepad_CurrentReading.png-dark
    • Gamepad_Enumeration.png-dark
    • Grid_ColSpan_Bottom.png-dark
    • Grid_ColSpan_Bottom.png
    • Grid_DataBound_ColumnRow_Definitions.png-dark
    • Grid_DataBound_ColumnRow_Definitions.png
    • Grid_def_MinMaxValues.png-dark
    • Grid_def_MinMaxValues.png
    • Grid_DynamicRowColumn.png-dark

@MartinZikmund

Copy link
Copy Markdown
Member Author

Closing in favor of #24961, which carries all of this PR's commits plus the fixes for the review threads above (scene hand-over hardening in e3e51fb, script fixes in 0fe103a) and the rest of the macOS-14 move (tvOS, macOS desktop, cleanup).

@unoplatform unoplatform deleted a comment from unodevops Oct 4, 2026
@unoplatform unoplatform deleted a comment from unodevops Oct 4, 2026
@unoplatform unoplatform deleted a comment from unodevops Oct 4, 2026
@unoplatform unoplatform deleted a comment from unodevops Oct 4, 2026
@unoplatform unoplatform deleted a comment from unodevops Oct 4, 2026
mikernet pushed a commit to Singulink/uno that referenced this pull request Oct 16, 2026
Backport of unoplatform#24680 (CI part) to servicing/6.8. The macOS-14 hosted image is retired on 2 Nov 2026. The shards now use the build image and Xcode, take the simulator runtime that Xcode ships, create the 12.9-inch iPad when the image lacks it, and install with xcrun simctl instead of idb.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018riLfyvT4wZYEh8iFjWkKa
ramezgerges pushed a commit to ramezgerges/uno that referenced this pull request Nov 2, 2026
Backport of unoplatform#24680 (CI part) to release/stable/6.7. The macOS-14 hosted image is retired on 2 Nov 2026. The shards now use the build image and Xcode, take the simulator runtime that Xcode ships, create the 12.9-inch iPad when the image lacks it, and install with xcrun simctl instead of idb.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018riLfyvT4wZYEh8iFjWkKa
@MartinZikmund
MartinZikmund deleted the dev/mazi/ci-ios-image branch November 12, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: Speed up the iOS runtime test shards and move them off macOS 14

4 participants