Skip to content

[ci] Require the exact iOS simulator runtime and accept already-installed runtimes - #40407

Merged
kubaflo merged 12 commits into
mainfrom
dev/kubaflo/net11-exact-sim-runtime
Nov 19, 2026
Merged

kubaflo merged 12 commits into
mainfrom
dev/kubaflo/net11-exact-sim-runtime

Conversation

@kubaflo

@kubaflo kubaflo commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Target Branch

This PR is for Initial base
New features, API changes, or .NET 12 work (including .NET 12 fixes) main
.NET 11 servicing fixes net11, for review
Older servicing, release integration, infrastructure, or documentation The branch designated for that work

For .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into net11; agents must not retarget or merge.

Description of Change

Fixes the "Install Simulator Runtimes" step in eng/pipelines/common/provision.yml, which fails on the updated ACES_VM_SharedPool_GoldenGate image (Xcode 27.0/27.1/27.2).

Problem

  • xcodebuild -downloadPlatform iOS -buildVersion 27.2 prints "iOS 27.2 (arm64Only) is already downloaded." and exits 70 when the runtime is installed. The step treated any non-zero exit as a wedged CoreSimulatorService, deleted all runtimes and downloaded again.
  • -buildVersion 27.2 is ambiguous: it returns 24B114, 24B8117, 24B91014 or 24B91016s. 24B91014/24B91016s register as com.apple.CoreSimulator.SimRuntime.iOS-27-2-iPhone19-4. XHarness looks for exactly iOS-27-2, so RunOniOS fails either in the smoke test (simctl create → SimError 403 "Incompatible device") or at boot ("Simulator failed to fully boot… UDID:" empty).
  • On maui-pr (iOS 27.0) every job hits the same exit-70 path and re-downloads the 8 GB runtime needlessly; it recovers only because 27.0 has one build.

Fix

  • New required_runtime_create_usable helper: requires the exact iOS-MAJOR-MINOR runtime to be available and simctl create-usable with an iPhone device type that runtime supports (prefers iPhone-11-Pro, which XHarness uses).
  • "is already downloaded." (or exit 0) + usable exact runtime → done; no deletion, no re-download.
  • Recovery/retry loop uses the same helper, so a device-specific build no longer ends the loop; it retries until the plain runtime is installed.
  • Final verification no longer counts device-specific runtimes via the platform+version fallback.

Evidence

  • dotnet-maui-build 3139948 RunOniOS_MauiNativeAOT (log 1356): "already downloaded" → exit 70 → delete → 24B91014 ×3, 24B91016s → "Incompatible device" ×5 → step failed.
  • Same build: job with only 24B91014 passed install but failed tests (empty UDID); jobs with 24B114 / 24B8117 passed.
  • maui-pr 1687937: all 19 install steps printed "iOS 27.0 (arm64Only) is already downloaded.", exited 70 and re-downloaded 24A434.

Validation

  • YAML parse and bash -n of the extracted step script: passed.
  • Helper against mocked simctl JSON: variant-only → fails (rc=1); generic + iPhone-11-Pro → picks iPhone-11-Pro; generic without iPhone-11-Pro → falls back to its supported iPhone.
  • Helper against real local simctl (Xcode 27.2): iOS 26.5 usable (iPhone-11-Pro), iOS 27.1 usable (iPhone-Duo, the only supported iPhone), iOS 27.2 not installed → rc=1; smoke devices cleaned up.
  • Final-verification jq: real 26.5 → 1; injected iOS-27-2-iPhone19-4 only → 0.
  • Real CI run on GoldenGate pending (this PR's CI).

Issues Fixed

No issue filed; reported against the GoldenGate image rollout (dotnet-maui-build 3139948).

github-actions Bot and others added 11 commits November 18, 2026 11:51
… content (#40169)

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [ ] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Issue Description

On Android 16, switching between Entries with different keyboard types
can briefly display the previous keyboard layout before showing the
correct one, causing visible flickering. In the reproduction, each Entry
is dynamically added to a ContentView and replaced with a Label when
another cell is selected.

### Root Cause

RemoveAllViews() detached the focused native EditText without explicitly
clearing its focus. Removing a view is not the same as completing a
focus transition.

Android updates the keyboard through its input-method system
asynchronously. If the outgoing text field is still considered the
active input target, the keyboard can temporarily retain its
configuration while Android processes detachment, transfers focus, and
establishes the incoming Entry’s input connection.


### Description of Change

- Clear native focus from the outgoing ContentView content before
calling RemoveAllViews() on Android.
- Previously, removing content containing a focused Entry could leave
stale input-method state. When switching between Entries with different
keyboard types, the previous keyboard layout could briefly appear before
the correct layout.
- Explicitly clearing focus before removing the native view ensures that
the outgoing Entry relinquishes focus before the next Entry is attached
and focused.


### Issues Fixed
Fixes #38799

### Tested the behaviour in the following platforms
- [x] Android
- [ ] Windows
- [ ] iOS
- [ ] Mac

### Output Screenshot
Before Issue Fix | After Issue Fix |
|----------|----------|
|<video width="300" height="600" alt="Before Fix"
src="https://github.com/user-attachments/assets/62b49b56-86e3-48e8-9ae1-19e92106f5b0">|<video
width="100" height="100" alt="After Fix"
src="https://github.com/user-attachments/assets/55caabe9-2021-43c0-9407-31bbad08db4c">|

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [ ] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change
This pull request primarily improves shadow rendering support for
Win2D-based shapes on Windows and updates test conditions related to
shadow features. The most significant changes are the addition of logic
to handle `W2DGraphicsView` with `ShapeDrawable` in shadow rendering, as
well as updates to test preprocessor directives and references.

**Shadow rendering improvements:**

*
[`ShadowExtensions.cs`](diffhunk://#diff-6c904999b229ffd792f069a6a0ddaf850a67a046624c4e915b57ece230ca9a09R43-R51):
Added logic in `GetAlphaMaskAsync` to handle `W2DGraphicsView` with
`ShapeDrawable`, using the live visual for shadow rendering since
`RenderTargetBitmap` cannot capture Win2D content.
*
[`ShadowExtensions.cs`](diffhunk://#diff-6c904999b229ffd792f069a6a0ddaf850a67a046624c4e915b57ece230ca9a09R7):
Added necessary using directives for `Microsoft.Maui.Graphics.Win2D` and
aliased `ShapeDrawable` for clarity.
[[1]](diffhunk://#diff-6c904999b229ffd792f069a6a0ddaf850a67a046624c4e915b57ece230ca9a09R7)
[[2]](diffhunk://#diff-6c904999b229ffd792f069a6a0ddaf850a67a046624c4e915b57ece230ca9a09R16)

**Test updates:**

*
[`ShadowFeatureTests.cs`](diffhunk://#diff-560f9cb1cec21af3a1c6ae51a0b30849aea0f019d519990a0b24dba91971d67fL218-R218):
Updated the Windows shadow test exclusion to reference the correct
GitHub issue (`40172` instead of `27732`).
*
[`BoxViewFeatureTests.cs`](diffhunk://#diff-3455b54055dcfe7c51234f9e7cc13af77da827ea7b097f7fe77d44acad4b0f79L163):
Removed the preprocessor directive that disabled shadow tests on
Windows, re-enabling those tests.
[[1]](diffhunk://#diff-3455b54055dcfe7c51234f9e7cc13af77da827ea7b097f7fe77d44acad4b0f79L163)
[[2]](diffhunk://#diff-3455b54055dcfe7c51234f9e7cc13af77da827ea7b097f7fe77d44acad4b0f79L235)
<!-- Enter description of the fix in this section -->

### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

Fixes #31821 

### Tested the behavior in the following platforms
- [x] Windows
- [ ] Android
- [ ] iOS
- [ ] Mac

| Before Issue Fix | After Issue Fix |
|----------|----------|
| <img width="998" height="944" alt="BeforeFix1821"
src="https://github.com/user-attachments/assets/b4a526d3-a615-4fea-9ede-55129e23314e"
/> | <img width="1259" height="952" alt="AfterFix31821"
src="https://github.com/user-attachments/assets/17282ba8-85cb-48a0-814b-beac7642c7b6"
/> |
<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Jakub Florkowski <kubaflo123@gmail.com>
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

Most of the recent `net11` `maui-pr-uitests` red comes from Android API
30 jobs that are cancelled at the 240-minute job limit. The cause is a
lost emulator, not product regressions.

**What happens** (raw logs of build
[1680926](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1680926)
and
[1680462](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1680462),
e.g. API 30 Navigation and API 30 CollectionView3):

1. The emulator boots normally, and tests run for about 9–12 minutes.
2. `[Logcat] Logcat terminated with code 255` appears and adb reports
`device 'emulator-5554' not found`. The emulator is gone.
3. The remaining fixtures of attempt 1 fail quickly once session
recreation fails.
4. `RunUITestsWithRetry` starts **UI test attempt 2** against the
still-missing device. Every fixture now waits about 3.7 minutes in
`AppiumServerContext.CreateUIClientContext`: 11 tries × Appium's
20-second "Could not find a connected Android device".
5. The job runs until Azure DevOps cancels it at 240 minutes. Most of
the failed rows in those builds are these setup failures.

The same tests pass on `candidate/11.0.1xx-sr2`, and none of
`eng/devices`, `UITest.Appium` or `UITest.NUnit` differs between
`net11`, the candidate and `main`. So this is an infrastructure flake
that the retry path amplifies, with no existing fix to backport.

**Fix**

- `RunUITestsWithRetry` gets an optional `beforeAttempt` hook that runs
before **every** attempt, including attempt 1. The iOS, Mac Catalyst and
Windows callers are unchanged.
- Running it only before retries was not enough. In this PR's run
[1682445](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1682445),
three API 30 jobs installed the app and then lost the emulator during
the roughly 2-minute UI-test project build, before attempt 1. Every
fixture in attempt 1 then waited 3 min 40 s (Shell1: 68 fixtures,
CarouselView: 99, 0 passed), and the jobs were cancelled at 240 minutes
before the retry hook could run.
- On Android, the hook checks `sys.boot_completed`:
  - If the device is healthy, it does nothing (one `getprop`).
- If the emulator started by the script is gone, it cleans up, restarts
the emulator through the existing `HandleVirtualDevice` path, and
reinstalls the app with `ExecutePrepareUITests` before the attempt.
- If that cleanup throws (for example `AdbEmuKill` fails), the hook
kills the old emulator process directly before restarting, so the same
AVD is never started twice. In a local fault-injection check, the
previous code left the old PID alive, started a duplicate, and timed out
after about 10 minutes; with this fallback, recovery finished in 39 s.
- Before restarting, the hook waits (bounded by
`EmulatorKillTimeoutSeconds`) until the old process has **confirmed
exited**. If it hasn't, the hook fails the attempt rather than start a
duplicate instance of the same AVD.
- If the device was not started by the script, it logs a warning and
runs the tests as before. Local runs against a user-supplied device are
unchanged.
- `uitest-retry.cake`: a retry no longer leaves never-run ignored tests
as failures. When the device is lost during a fixture's OneTimeSetUp,
NUnit fails every child with `site="Parent"`. If OneTimeTearDown also
throws, the fixture site becomes `TearDown` instead of `SetUp`. Ignored
tests then come back from a green retry as Skipped/Ignored: either a
static `[Ignore]` with the same reason, or a runtime `Assert.Ignore`
with `runstate="Runnable"`. The merge accepted only the
`SetUp`+static-reason shape, so the job failed even though the retry was
green.
- The merge now treats a parent-site error as never-run when the fixture
failed in setup (site `SetUp`, or the child's message starts with
`OneTimeSetUp:`). It accepts a retry that ignores such a test, and
accepts fixtures that contain only such recovered ignores. A test that
actually ran and failed is still never accepted.

**Validation**

- `dotnet cake eng/devices/{android,catalyst,windows,ios}.cake
--target=uitest --dryrun` compiles. iOS has the same pre-existing local
teardown error with and without this change.
- Local end-to-end check on an API 30 arm64 emulator (adb pinned to
`emulator-5554`): a temporary target ran the real `connectToDevice` and
`uitest-prepare` (installed the app), then called
`EnsureDeviceForUITestAttempt` as at the attempt-1 call site.

  | Case | Result |
  | --- | --- |
  | Healthy device | Hook returned in 0.0 s (no-op) |
| `adb emu kill` after install (the 1682445 mode) | `boot_completed` →
null; hook logged the warning, restarted the emulator, and reinstalled
the app (XHarness exit code 0) in 46 s; afterwards `boot_completed` = 1
and `pm path` showed the app |
  | Healthy again after recovery | 0.0 s no-op |
| Missing device not started by the script | Warning logged, no throw |

- Confirmed-exit fault injection (local, API 30):

  | Scenario | Before | After |
  | --- | --- | --- |
| Cleanup returns but the emulator stays alive | Duplicate start; boot
timed out after 10m32s | Attempt fails after 60 s with "did not exit …
not restarting"; no duplicate |
| Emulator killed externally | — | One restart, app reinstalled,
XHarness exit 0 (49 s) |
| Cleanup throws | — | Direct kill, one restart, XHarness exit 0 (41 s)
|

- **CI proof of recovery:** in this PR's run
[1682664](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1682664),
Controls (API 30) Label lost the emulator during attempt 1. All 126
tests failed in OneTimeSetUp, about 3m40s each. Before attempt 2 the
hook restarted Emulator_30 and reinstalled the app, and **attempt 2
passed 124 tests with 2 skipped** in 14 minutes.
- **Retry merge:** that job was still marked failed because two
never-run ignored tests stayed Failed: `Issue488TestsLongTextRotation`
(static `[Ignore]`, fixture site `TearDown`) and
`LabelUITests.IsEnabled` (runtime `Assert.Ignore`). The real TRX and
NUnit XML from both attempts were replayed offline through
`UITestRetry.MergeResults`:

  | Input | Before | After |
  | --- | --- | --- |
| Real 1682664 Label artifacts | Merged outcome Failed (`IsEnabled`,
`Issue488TestsLongTextRotation`) | Completed, 0 failed, no run errors |
  | Retry `IsEnabled` actually fails | — | Failed |
  | Original `IsEnabled` actually ran (site not Parent) | — | Failed |
  | Static ignore reason mismatch | — | Failed |
  | No `OneTimeSetUp:` evidence | — | Failed |

The replay harness was local only; no test was committed, per policy for
CI scripts.
- Final validation is this PR's own `maui-pr-uitests` run.

### Issues Fixed

Fixes Android API 30 `maui-pr-uitests` jobs on `net11` hanging until the
240-minute timeout after the emulator is lost mid-run. Also fixes
recovered retries still failing the job when never-run ignored tests
come back as Skipped/Ignored.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…#40300)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

Follow-up to #40273, which recovers a lost Android emulator **between**
UI test attempts. That recovery cannot help when the emulator dies
**during** an attempt: every remaining fixture then calls
`AppiumServerContext.CreateUIClientContext`, which tries to create a
session 11 times (`retries++ < 10`, about 20s each because UiAutomator2
waits 20s for a device). Each fixture fails only after **3m40s**.

Evidence from `maui-pr-uitests` run
[1682664](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1682664)
(PR #40273), job "Controls (API 30) Label":
- The emulator vanished about 3 minutes into attempt 1.
- All 126 Label tests then failed in `OneTimeSetUp` with `Could not find
a connected Android device in 20000ms`, each after 3m40s.
- The test step took **195 minutes**; normally it takes 16–23 minutes.
- Only after that did the between-attempt recovery restart the emulator.

`net11` run
[1683205](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1683205)
showed the same job still running after 115+ minutes. The candidate
(#40116) and `main` have identical copies of this file, so no existing
fix covers it.

**Change:** after one fixture exhausts all retries, later fixtures in
the same test process get a single attempt. A successful session
restores full retries.
- The first failure still gets the full retry budget, so transient
Appium or device hiccups keep the current tolerance.
- CI retries start a new `dotnet test` process, so each attempt starts
with full retries, and the emulator recovery from #40273 still runs
before it.
- No test is skipped, and no tolerance or baseline changes.

### Validation

Ran a local console harness that references `UITest.Core` and
`UITest.Appium`, starts the real Appium server (uiautomator2 3.9.1), and
calls `CreateUIClientContext` with an Android config and no connected
device. This simulates fixtures after the emulator is lost.

| Build | Fixture 1 | Fixture 2 | Fixture 3 |
| --- | --- | --- | --- |
| `net11` (baseline, d0547a0) | 221s | 221s | — |
| This PR | 221s | 20s | 20s |

For a 126-fixture category, the time to fail after losing the emulator
drops from about 7.7h (capped by the job timeout) to about 45 min. The
same error message is still reported for every test.

### Issues Fixed

Fixes CI hangs in `maui-pr-uitests` Android jobs after mid-attempt
emulator loss (no tracking issue).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…m's BACK fallback (#40361)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

Test-only fix for the intermittent Android Material3 UI test failure
`Issue35119.DialogsRenderWithM3Styling`. It times out at
`Issue35119.cs:41` in `TapDisplayAlertButton("Cancel")` and passes on
retry. It failed in 6 of 18 cached net11/candidate Material3 logs.

**Root cause (from the failing attempt's logcat, maui-pr-uitests
1687006, Material3 drop):**
1. The prompt opens and the IME shows (`ImeTracker onShown`).
2. `App.DismissKeyboard()` calls Appium `hideKeyboard`, which sends ESC.
The IME consumes it (`HIDE_SOFT_INPUT_FROM_VIEW`), but the hide
animation stalls (`STATUS_TIMEOUT`).
3. appium-adb's `hideKeyboard` polls `mInputShown` for ~1s and then
falls back to **BACK**. That BACK reaches the dialog's back callback:
`VRI[Prompt Title]: Dropping event due to root view being removed:
KEYCODE_BACK`. The prompt is cancelled before the test taps "Cancel".

**Fix:** if the IME is visible, send only ESC and wait (with the normal
helper timeout) for the keyboard to hide. The test never sends BACK. ESC
is sent only while the IME is shown, because without a visible IME it
would reach the dialog. Product code, the shared `DismissKeyboard`
helper (used by 43 tests), assertions and baselines are unchanged.

**Local validation** (`Maui39688_M3_API36` emulator with CI's Material3
CoreCLR HostApp APK from build 1687006):
- **Mechanism probe** (temporary, not committed; fresh fixture, status
initially "No dialog shown yet"):
- ESC + BACK on the open prompt dismissed it and set "Prompt result:
cancelled" with no Cancel tap.
  - ESC alone hid the keyboard and left the prompt open.
- **Fixed test:** passed 3/3 at normal animation speed and 1/1 at 10×
animation scale. The Appium log shows only `pressKey 111` for the prompt
and no `hideKeyboard` or BACK.
- **Limitation:** the CI IME stall did not reproduce locally. The
original test also passed at 10× because ESC hid the IME within Appium's
1s window. Red→green is therefore shown at the mechanism level (CI
logcat plus the probe), not as a local test reproduction.

The test file is identical on `net11`, the candidate SR2 branch and
`main`, and no open PR addresses this.

### Issues Fixed

Fixes intermittent CI failure of `Issue35119.DialogsRenderWithM3Styling`
(test added in #35121).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

CI hardening only: no product, test, or assertion changes.

The Android UI-test emulators use `google_apis_playstore` images (API 30
and API 36, `eng/pipelines/common/ui-tests.yml`). A few minutes after
boot, the Play Store (Finsky, `reason=auto_update`) downloads and
installs a newer Google Play services APK. No Google account is needed
for this. Replacing `com.google.android.gms` makes every process that
loaded its dynamite/Chimera modules restart itself. The MAUI HostApp is
one of those processes:

```
PackageManager: Force stopping com.google.android.gms ... pkg removed
DynamiteLoaderV2Impl / ChimeraModuleLdr: Module config changed, forcing restart due to module googlecertificates | maps_dynamite
Sending signal. PID: <app> SIG: 9
ActivityManager: Process com.microsoft.maui.uitests (pid <app>) has died: fg TOP
```

The running UI test then fails in TearDown with "The app was expected to
be running still". The in-job retry usually recovers, but the crash
costs a retry. It can also fail the job when the kill lands during the
retry.

This PR disables the Play Store package on CI emulators in
`PrepareDevice`, using `pm disable-user --user 0 com.android.vending`.
That call works without root on user builds.
- Google Play services itself stays enabled and unchanged.
- The disabled state persists across the emulator recovery restarts,
because they don't wipe data.
- It runs only under `IsCIBuild()`, so local developer emulators aren't
touched.
- On images without the Play Store, `SafeAdbShell` just logs the
harmless `pm` error.

#### CI evidence

The same sequence appears in the drop logcats of three app crashes that
the in-job retry recovered, in candidate UI build
[1686708](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1686708):
- Material3 on API 36: GMS replaced about 4 minutes after emulator
start.
- SafeAreaEdges on API 36.
- Border/Button on API 30: GMS replaced about 13 minutes after start.

The same retry-recovered crashes occur on `net11` UI build
[1685487](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685487),
so this isn't branch-specific. Across the observed jobs, the update
landed about 4–14 minutes after emulator start. `PrepareDevice` runs
about 1 minute after start, before that window.

#### Local validation

Fresh `-wipe-data` boots of `google_apis_playstore` arm64 AVDs
(pixel_5), checked every minute for GMS installs, GMS package removals,
and the GMS version:

| Run | Result over the monitoring window |
| --- | --- |
| API 30 baseline | Play Store self-updated at about 11 min. GMS updated
20.18.17 → 26.45.31 at about 13 min, with "pkg removed" and
ChimeraModuleLdr "forcing restart" kills. |
| API 30 + `pm disable-user` | 20 min: 0 installs, 0 GMS removals, still
20.18.17 |
| API 36 baseline | GMS updated 25.07.34 → 26.45.31 at about 4 min |
| API 36 + `pm disable-user`, applied about 20 s after boot | 15 min: 0
installs, 0 GMS removals, still 25.07.34 |

`dotnet cake eng/devices/android.cake --target=uitest-prepare --dryrun`
compiles the script. The full cake path is validated by this PR's actual
`maui-pr-uitests` run.

### Issues Fixed

No issue filed; this fixes flaky Android UI-test CI (app killed by a
Google Play services auto-update).

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…up (#40381)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

Android UI test jobs can lose all tests when the emulator wedges before
it finishes booting. `uitest-prepare` already retries five times
(`RunUITestSetupWithRetry`), but each retry reuses the same emulator.
Every attempt waits another 600 s on that wedged instance. The restart
added in #40273 runs only before test attempts, not before setup
retries.

Examples:
- net11 UI build 1687571, Android API30 Shadow (log 6089): the emulator
shows `offline` and then "no devices" for about an hour. All 5 setup
attempts wait on the same process, which stays alive until final
cleanup. No tests run.
- Candidate UI build 1686311 CV2 (log 3682) has the same five attempts
with no relaunch. There the device was stuck `unauthorized`.

Change (`eng/devices/android.cake`):
- I extracted the existing #40273 restart logic into
`RestartEmulatorIfNotBooted(nextStep)`.
- `uitest-prepare` calls it before setup attempts 2–5.
- It restarts only an emulator this script launched, and only when
`sys.boot_completed` is not set. Booted devices and externally provided
devices are untouched.
- `EnsureDeviceForUITestAttempt` keeps its behavior.

The root cause of the emulator wedge is unknown. This change only lets
the retries recover from it.

### Validation

Local, API30 `google_apis_playstore` arm64 AVD, with CI retries enabled
(`AGENT_NAME` set) and an isolated ADB server and home directory. To
simulate the wedge, a watcher sends SIGSTOP to the emulator process 2 s
after launch. This reproduces the CI shape: adb shows `device offline`
and the boot wait fails at 600 s.
- **Baseline (net11 `android.cake`):** attempt 1 failed with "The
emulator did not finish booting in time". Attempt 2 waited again on the
same stopped PID, with no relaunch. **Red.**
- **This PR:** attempt 1 failed the same way. Then "The Android emulator
is not booted; restarting it before retrying UI test setup." The
emulator was killed and relaunched, booted in 15 s, and the APK
installed. Exit 0. **Green.**
- **Control (no wedge):** normal boot, no restart. Exit 0.

The `unauthorized` mode (log 3682) was not reproduced locally. A
relaunch is expected to help it as well, but that is not validated.

### Issues Fixed

Fixes net11 Android UI test jobs lost to an emulator that wedges during
boot (no tracking issue).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…40391)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

CI hardening only. No product, test, or pipeline YAML changes.

**Symptom.** Candidate UI build
[1687815](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1687815)
(#40116), job *Controls Lifecycle,ManualReview,Maps* on Mac, failed in
**Install Appium** before any test ran. All 5 RetryHelper attempts
failed. Log 4334 shows this chain:

1. `npm list -g appium` → not installed.
2. The normal `npm i --location=global appium@2.17.1` fails with a
transient `ERR_SOCKET_TIMEOUT`.
3. `InstallAppium` falls back to `sudo -E npm i --location=global
appium@2.17.1`, which **succeeds**.
4. `appium driver install uiautomator2@4.2.1` (runs as the agent user)
fails with `EACCES: mkdir '/Users/cloudtest/.npm/_cacache/index-v5/…'`.
npm explains: *"Your cache folder contains root-owned files … sudo chown
-R 501:20 /Users/cloudtest/.npm"*.
5. Retries 2–5 fail on the same root-owned cache (`EACCES`/`EEXIST`),
then on `ENOTEMPTY` debris in `.appium/node_modules/appium`.

**Root cause.** `sudo -E` preserves `HOME`, so the elevated npm uses and
populates the user's `~/.npm/_cacache` as root. Every later non-root npm
call on the agent then fails. A single network blip becomes a job
failure that retries cannot fix.

**Same signature elsewhere (UI pipeline 313, builds since 11-13):**

| Build | Context | Agent / log | Notes |
| --- | --- | --- | --- |
| 1687815 | candidate | Mac, AcesShared 107, log 4334 | This failure. |
| 1686824 | PR #40351 | Mac, AcesShared 90, log 3817 | Identical chain.
|
| 1685341 | main | 13 Linux jobs | Network outage; the sudo fallback
then hit `EACCES` on `/home/cloudtest/.npm/_cacache`. |

The next job on AcesShared 107 (log 5398) passed, so the damage is per
job, not per machine.

**Fix.** In `src/Provisioning/Provisioning.csproj`, the macOS/Linux
`ElevatedNpmCommand` now passes `--cache
"<temp>/maui-elevated-npm-cache"`. npm keeps its logs and
update-notifier state under the cache directory too, so the elevated
install no longer writes anything into `~/.npm`. The normal
(non-elevated) path, the Windows elevation command, versions, timeouts,
and retry budgets are unchanged.

**Validation.** Real root was unavailable locally, so I emulated it:

- Node/npm matched CI: Node 20.3.1 / npm 9.6.7, the UseNode version in
`ui-tests-steps.yml`.
- `HOME`, `APPIUM_HOME`, and the npm global prefix were isolated.
- A `sudo` shim runs the command, then removes write permission from
every path that command **created**. This matches what a non-root user
can do with root-owned 755/644 entries.
- An `npm` shim fails the first non-elevated `npm i --location=global
appium@…` with `ERR_SOCKET_TIMEOUT`.

Each state ran the real target, `dotnet build
./src/Provisioning/Provisioning.csproj -t:ProvisionAppium
-p:SkipAppiumDoctor=true`, repeated up to CI's 5 attempts:

| State | Result |
| --- | --- |
| Baseline (`origin/net11`) | **Red 4/4**: `appium driver install
uiautomator2@4.2.1` fails with npm's "cache folder contains root-owned
files" `EACCES`; 3,612 non-writable entries left in `~/.npm`. |
| Fix | **Green on attempt 1**: uiautomator2 4.2.1, mac2 1.20.3, and
xcuitest 7.32.0 installed; 0 root-created paths under `HOME` or
`APPIUM_HOME`. |
| Fix reverted | **Red 5/5**, same `EACCES`. |
| Fix restored | **Green on attempt 1**. |
| Control (no network failure) | **Green**; the elevated command is not
invoked. |

In the emulation, the elevated install created nothing under
`APPIUM_HOME`, so isolating the npm cache is enough. Other checks:
`xmllint --noout` on the csproj and `git diff --check` both pass. Real
CI on this PR exercises the normal path; the elevated path only runs
after a network failure.

I found no open or recently merged PR that changes the elevated npm
install. `Provisioning.csproj` is byte-identical on `net11`, `main`,
`inflight/current`, and `candidate/11.0.1xx-sr2`.

### Issues Fixed

No tracking issue. Found while analysing candidate PR #40116 CI (UI
build 1687815).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This pull request updates the following dependencies

[marker]: <> (Begin:fc4a0e63-cc9b-414d-9375-11dd045dcfa9)
## From https://github.com/dotnet/android
- **Subscription**:
[fc4a0e63-cc9b-414d-9375-11dd045dcfa9](https://maestro.dot.net/subscriptions?search=fc4a0e63-cc9b-414d-9375-11dd045dcfa9)
- **Build**:
[11.0.1xx-37b36910817c0cd8f2df9b7b8b6a086cf00ea13f-1](https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=16059855)
([341964](https://maestro.dot.net/channel/8298/github:dotnet:android/build/341964))
- **Date Produced**: November 18, 2026 12:39:38 AM UTC
- **Commit**:
[37b36910817c0cd8f2df9b7b8b6a086cf00ea13f](dotnet/android@37b3691)
- **Branch**:
[release/11.0.1xx](https://github.com/dotnet/android/tree/release/11.0.1xx)

[DependencyUpdate]: <> (Begin)

- **Dependency Updates**:
  - From [37.2.15 to 37.2.40][1]
     - Microsoft.Android.Sdk.Windows

[1]: dotnet/android@d73c903...37b3691

[DependencyUpdate]: <> (End)


[marker]: <> (End:fc4a0e63-cc9b-414d-9375-11dd045dcfa9)



[marker]: <> (Begin:0340b3ac-0154-4d65-98b8-f534ebc24108)
## From https://github.com/dotnet/dotnet
- **Subscription**:
[0340b3ac-0154-4d65-98b8-f534ebc24108](https://maestro.dot.net/subscriptions?search=0340b3ac-0154-4d65-98b8-f534ebc24108)
- **Build**:
[20261116.16](https://dev.azure.com/dnceng/internal/_build/results?buildId=3137644)
([341850](https://maestro.dot.net/channel/8298/github:dotnet:dotnet/build/341850))
- **Date Produced**: November 17, 2026 12:08:07 PM UTC
- **Commit**:
[f41eb11e376b9f85a5c896de7b3c8551828f415e](dotnet/dotnet@f41eb11)
- **Branch**:
[release/11.0.1xx](https://github.com/dotnet/dotnet/tree/release/11.0.1xx)

[DependencyUpdate]: <> (Begin)

- **Dependency Updates**:
  - From [11.0.0 to 11.0.1][2]
     - Microsoft.AspNetCore.Authentication.Facebook
     - Microsoft.AspNetCore.Authentication.Google
     - Microsoft.AspNetCore.Authentication.MicrosoftAccount
     - Microsoft.AspNetCore.Authorization
     - Microsoft.AspNetCore.Components
     - Microsoft.AspNetCore.Components.Analyzers
     - Microsoft.AspNetCore.Components.Forms
     - Microsoft.AspNetCore.Components.Web
     - Microsoft.AspNetCore.Components.WebAssembly
     - Microsoft.AspNetCore.Components.WebAssembly.Server
     - Microsoft.AspNetCore.Components.WebView
     - Microsoft.AspNetCore.Metadata
     - Microsoft.Extensions.Configuration
     - Microsoft.Extensions.Configuration.Abstractions
     - Microsoft.Extensions.Configuration.Json
     - Microsoft.Extensions.DependencyInjection
     - Microsoft.Extensions.DependencyInjection.Abstractions
     - Microsoft.Extensions.FileProviders.Abstractions
     - Microsoft.Extensions.Hosting.Abstractions
     - Microsoft.Extensions.Logging
     - Microsoft.Extensions.Logging.Abstractions
     - Microsoft.Extensions.Logging.Console
     - Microsoft.Extensions.Logging.Debug
     - Microsoft.Extensions.Primitives
     - Microsoft.JSInterop
     - Microsoft.NETCore.App.Ref
  - From [11.0.0-beta.26514.118 to 11.0.0-beta.26566.116][2]
     - Microsoft.DotNet.Arcade.Sdk
     - Microsoft.DotNet.Build.Tasks.Feed
     - Microsoft.DotNet.Build.Tasks.Installers
     - Microsoft.DotNet.Build.Tasks.Workloads
     - Microsoft.DotNet.Helix.JobMonitor
     - Microsoft.DotNet.Helix.Sdk
     - Microsoft.DotNet.RemoteExecutor
     - Microsoft.DotNet.SharedFramework.Sdk
     - Microsoft.DotNet.XUnitExtensions
  - From [11.0.100-rtm.26514.118 to 11.0.101-servicing.26566.116][2]
     - Microsoft.NET.Sdk

[2]: dotnet/dotnet@a586537...f41eb11

[DependencyUpdate]: <> (End)


[marker]: <> (End:0340b3ac-0154-4d65-98b8-f534ebc24108)

---------

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
…lled runtimes

`xcodebuild -downloadPlatform iOS -buildVersion MAJOR.MINOR` exits 70 with
"is already downloaded." when the runtime is installed. The step treated that
as a wedged CoreSimulatorService, deleted every runtime and downloaded again.
The download can return a device-specific build (iOS 27.2 24B91014/24B91016s)
that registers as iOS-MAJOR-MINOR-<device>, which XHarness can't use, so
RunOniOS failed in setup ("Incompatible device") or at boot (empty UDID).

Require the plain com.apple.CoreSimulator.SimRuntime.iOS-MAJOR-MINOR runtime
to be create-usable with an iPhone device type it supports, skip recovery when
it already is, and stop counting device-specific builds in final verification.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 18, 2026 23:37 — with GitHub Actions Inactive
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40407

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40407"

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool November 18, 2026 23:38 — with GitHub Actions Inactive
@azure-pipelines

This comment has been minimized.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026
@MauiBot

MauiBot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@kubaflo — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Android


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026

@github-actions github-actions Bot 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.

Expert Review — 1 finding

Reviewed commit 273c12a.

Source assessment incomplete (4/5 dimensions); finding count is partial.

See inline comments for details.

echo "Runtime NOT create-usable (attempt $runtimeInstallAttempt/$maxRuntimeAttempts): '$SMOKE_UDID' — CoreSimulatorService still wedged."
else
echo "Could not resolve an iOS runtime/devicetype to smoke-test (attempt $runtimeInstallAttempt/$maxRuntimeAttempts; rt='$SMOKE_RT' dt='$SMOKE_DT')."
if required_runtime_create_usable; then

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.

[moderate] Regression Prevention and Test Coverage - Update the existing provisioning contracts alongside this replacement. .github/scripts/Review-PR.Tests.ps1 still unconditionally requires a SMOKE_RT=... assignment in its 'Simulator runtime provisioning contract' test, but this PR removes that assignment. Its four download-outcome cases also extract their script using the removed if [[ "$RC" != "0" ]]; then statement as the ending delimiter, so the extraction now fails its .Success assertion whenever Bash is available. These assertions read this template directly, so the unchanged suite no longer matches the implementation. Adapt the assertions/extractor to the new helper and readiness branch, including the already-downloaded usable-runtime case and its recovery-required counterpart.

@kubaflo

kubaflo commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

CI evidence from raw logs of maui-pr 1688995 (this PR) and 1688996 (same commit on #40060):

Build Install Simulator Runtimes logs Result
1688995 147, 156, 179 "iOS 27.0 (arm64Only) is already downloaded." → iOS-27-0 create-usable (iPhone-11-Pro) → no runtime deletion, no re-download; step ~2 s
1688996 147, 168, 170 same; log 168 is an agent with 4 runtimes installed

Before this change every such step deleted all runtimes and re-downloaded the 8 GB iOS 27.0 runtime (e.g. all 19 steps in maui-pr 1687937).

The iOS 27.2 device-specific-build path (iOS-27-2-iPhone19-4) only occurs on internal dotnet-maui-build jobs; it needs internal CI on the inflight branch after a maintainer retargets this PR.

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026
@MauiBot

MauiBot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@kubaflo — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Android


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026
Restore the RC boundary and version-checked SMOKE_RT selection the existing
Review-PR.Tests.ps1 contract extracts, while still requiring the exact
iOS-MAJOR-MINOR runtime identifier.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026
@MauiBot

MauiBot commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@kubaflo — existing-test verification; Setup did not capture a tested commit.

Result INCONCLUSIVE Platform Android


🧪 Gate analysis — click to expand

⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect.

No interpretable test-group summary was produced. No additional test execution is inferred.

Setup did not capture a verified PR head; no commit is claimed as tested.

No immutable without-fix baseline was prepared.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026

@github-actions github-actions Bot 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.

Expert Review — 2 findings

Reviewed commit 962e251.

Source assessment incomplete (4/5 dimensions); finding count is partial.

See inline comments for details.

RUNTIME_READY=0
if [[ "$RC" != "0" ]]; then
echo "First attempt failed with exit code $RC, deleting all simulator runtimes and trying again..."
if [[ "$ALREADY_DOWNLOADED" == "1" ]] && required_runtime_create_usable; then

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.

[moderate] Regression Prevention and Test Coverage - The existing download-outcome tests in .github/scripts/Review-PR.Tests.ps1:1015-1047 stop extracting the script before this readiness decision. They never invoke the helper or observe whether recovery runs, and none supplies exit 70 with 'is already downloaded.'. Consequently, restoring unconditional destructive recovery or accepting an unusable already-downloaded runtime would evade the assertions. Extend the contract through the readiness decision: an exact available runtime with successful create must skip recovery, while variant-only, unavailable, or create-failing runtimes must enter recovery, including after an exit-zero download. Preserve the unavailable-download and connection-failure controls.

((.runtimeIdentifier // "") == $id)
or
(((.platformIdentifier // "") | contains("iphonesimulator"))
(((.runtimeIdentifier // "") == "")

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.

[moderate] Regression Prevention and Test Coverage - The extracted-jq test in .github/scripts/Review-PR.Tests.ps1:1050-1072 has no fixture discriminating this new empty-identifier guard. Its exact-identifier cases omit platform/version, and its matching platform/version case omits the identifier. Removing this guard therefore leaves all current expected results unchanged while again counting a Ready iOS-27-2-iPhone19-4 image with platform com.apple.platform.iphonesimulator and version 27.2. Add that variant-only fixture with all three fields populated and expect zero, retaining the identifier-less matching fallback expecting one.

@kubaflo
kubaflo changed the base branch from net11 to main November 19, 2026 11:01
@kubaflo

kubaflo commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

@dalexsoto stamp

@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Stamping as requested by @kubaflo; no code review performed.

@kubaflo
kubaflo merged commit 5c7a422 into main Nov 19, 2026
30 of 38 checks passed
@kubaflo
kubaflo deleted the dev/kubaflo/net11-exact-sim-runtime branch November 19, 2026 11:25
kubaflo added a commit to kubaflo/maui that referenced this pull request Nov 19, 2026
Resolve global.json, eng/Versions.props and eng/Version.Details.xml
conflicts by keeping the .NET 12 SDK/runtime/Android values; take main's
.NET 11.0.1 servicing package bumps, Arcade 11.0.0-beta.26566.116 and the
GoldenGate simulator runtime fix (dotnet#40407).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Nov 19, 2026
@kubaflo kubaflo mentioned this pull request Nov 19, 2026
1 task
kubaflo added a commit to kubaflo/maui that referenced this pull request Nov 19, 2026
…lled runtimes (dotnet#40407)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

Fixes the "Install Simulator Runtimes" step in
`eng/pipelines/common/provision.yml`, which fails on the updated
`ACES_VM_SharedPool_GoldenGate` image (Xcode 27.0/27.1/27.2).

**Problem**
- `xcodebuild -downloadPlatform iOS -buildVersion 27.2` prints "iOS 27.2
(arm64Only) is already downloaded." and exits **70** when the runtime is
installed. The step treated any non-zero exit as a wedged
CoreSimulatorService, deleted **all** runtimes and downloaded again.
- `-buildVersion 27.2` is ambiguous: it returns 24B114, 24B8117,
24B91014 or 24B91016s. 24B91014/24B91016s register as
`com.apple.CoreSimulator.SimRuntime.iOS-27-2-iPhone19-4`. XHarness looks
for exactly `iOS-27-2`, so RunOniOS fails either in the smoke test
(`simctl create` → SimError 403 "Incompatible device") or at boot
("Simulator failed to fully boot… UDID:" empty).
- On maui-pr (iOS 27.0) every job hits the same exit-70 path and
re-downloads the 8 GB runtime needlessly; it recovers only because 27.0
has one build.

**Fix**
- New `required_runtime_create_usable` helper: requires the exact
`iOS-MAJOR-MINOR` runtime to be available and `simctl create`-usable
with an iPhone device type that runtime supports (prefers iPhone-11-Pro,
which XHarness uses).
- "is already downloaded." (or exit 0) + usable exact runtime → done; no
deletion, no re-download.
- Recovery/retry loop uses the same helper, so a device-specific build
no longer ends the loop; it retries until the plain runtime is
installed.
- Final verification no longer counts device-specific runtimes via the
platform+version fallback.

**Evidence**
- dotnet-maui-build 3139948 RunOniOS_MauiNativeAOT (log 1356): "already
downloaded" → exit 70 → delete → 24B91014 ×3, 24B91016s → "Incompatible
device" ×5 → step failed.
- Same build: job with only 24B91014 passed install but failed tests
(empty UDID); jobs with 24B114 / 24B8117 passed.
- maui-pr 1687937: all 19 install steps printed "iOS 27.0 (arm64Only) is
already downloaded.", exited 70 and re-downloaded 24A434.

**Validation**
- YAML parse and `bash -n` of the extracted step script: passed.
- Helper against mocked `simctl` JSON: variant-only → fails (rc=1);
generic + iPhone-11-Pro → picks iPhone-11-Pro; generic without
iPhone-11-Pro → falls back to its supported iPhone.
- Helper against real local simctl (Xcode 27.2): iOS 26.5 usable
(iPhone-11-Pro), iOS 27.1 usable (iPhone-Duo, the only supported
iPhone), iOS 27.2 not installed → rc=1; smoke devices cleaned up.
- Final-verification jq: real 26.5 → 1; injected `iOS-27-2-iPhone19-4`
only → 0.
- Real CI run on GoldenGate pending (this PR's CI).

No issue filed; reported against the GoldenGate image rollout
(dotnet-maui-build 3139948).

---------
@kubaflo kubaflo mentioned this pull request Nov 20, 2026
1 task done
HarishKumarSF4517 pushed a commit to HarishKumarSF4517/maui that referenced this pull request Nov 20, 2026
…lled runtimes (dotnet#40407)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

Fixes the "Install Simulator Runtimes" step in
`eng/pipelines/common/provision.yml`, which fails on the updated
`ACES_VM_SharedPool_GoldenGate` image (Xcode 27.0/27.1/27.2).

**Problem**
- `xcodebuild -downloadPlatform iOS -buildVersion 27.2` prints "iOS 27.2
(arm64Only) is already downloaded." and exits **70** when the runtime is
installed. The step treated any non-zero exit as a wedged
CoreSimulatorService, deleted **all** runtimes and downloaded again.
- `-buildVersion 27.2` is ambiguous: it returns 24B114, 24B8117,
24B91014 or 24B91016s. 24B91014/24B91016s register as
`com.apple.CoreSimulator.SimRuntime.iOS-27-2-iPhone19-4`. XHarness looks
for exactly `iOS-27-2`, so RunOniOS fails either in the smoke test
(`simctl create` → SimError 403 "Incompatible device") or at boot
("Simulator failed to fully boot… UDID:" empty).
- On maui-pr (iOS 27.0) every job hits the same exit-70 path and
re-downloads the 8 GB runtime needlessly; it recovers only because 27.0
has one build.

**Fix**
- New `required_runtime_create_usable` helper: requires the exact
`iOS-MAJOR-MINOR` runtime to be available and `simctl create`-usable
with an iPhone device type that runtime supports (prefers iPhone-11-Pro,
which XHarness uses).
- "is already downloaded." (or exit 0) + usable exact runtime → done; no
deletion, no re-download.
- Recovery/retry loop uses the same helper, so a device-specific build
no longer ends the loop; it retries until the plain runtime is
installed.
- Final verification no longer counts device-specific runtimes via the
platform+version fallback.

**Evidence**
- dotnet-maui-build 3139948 RunOniOS_MauiNativeAOT (log 1356): "already
downloaded" → exit 70 → delete → 24B91014 ×3, 24B91016s → "Incompatible
device" ×5 → step failed.
- Same build: job with only 24B91014 passed install but failed tests
(empty UDID); jobs with 24B114 / 24B8117 passed.
- maui-pr 1687937: all 19 install steps printed "iOS 27.0 (arm64Only) is
already downloaded.", exited 70 and re-downloaded 24A434.

**Validation**
- YAML parse and `bash -n` of the extracted step script: passed.
- Helper against mocked `simctl` JSON: variant-only → fails (rc=1);
generic + iPhone-11-Pro → picks iPhone-11-Pro; generic without
iPhone-11-Pro → falls back to its supported iPhone.
- Helper against real local simctl (Xcode 27.2): iOS 26.5 usable
(iPhone-11-Pro), iOS 27.1 usable (iPhone-Duo, the only supported
iPhone), iOS 27.2 not installed → rc=1; smoke devices cleaned up.
- Final-verification jq: real 26.5 → 1; injected `iOS-27-2-iPhone19-4`
only → 0.
- Real CI run on GoldenGate pending (this PR's CI).

No issue filed; reported against the GoldenGate image rollout
(dotnet-maui-build 3139948).

---------
kubaflo added a commit to kubaflo/maui that referenced this pull request Nov 23, 2026
Rebased onto latest main via net11 (b8cc4e7, which contains main d4ae6c2). The PR diff is unchanged; previous head 7494403 squashed these commits:

- Move main to .NET 12
- Skip the net12 Apple scene-manifest validation for repo samples and test apps
- Provision JDK 21 for the .NET 12 Android workload
- Publish Helix xUnit payloads for the repo TFM
- Drop the iossimulator-x64 RID, which net12 iOS no longer ships
- Expect assembly version 12 in AssemblyInfoTests
- Use MAUI 11 rc.2 as the previous MauiVersion in integration tests
- Retry JDK provisioning with a longer backoff
- Run one iOS integration lane on the xcode-27 image
- Revert "Run one iOS integration lane on the xcode-27 image"
- Always use iossimulator-arm64 in integration tests
- Skip iOS runtimes XHarness can't create a simulator on
- Fix Windows CI on the .NET 12 preview SDK
- Skip .NET 12 iOS in public CI
- Make the device-test Mono lane iOS-only
- [ci] Restore public iOS coverage
- Fix iOS test host and migration validation
- Restore previous-framework Apple integration coverage
- Isolate Android test hosts from Apple builds
- Fix Android CoreCLR device test failures
- Select the pinned internal Xcode package
- Pass UI build arguments without expression evaluation
- Restore iOS device-test runner scene lifecycle
- Key Windows Switch hover state by ToggleSwitch
- Wait for asynchronous Android CoreCLR GC bridge release in device-test GC helper
- Restore Android Mono and iOS simulator-x64 test coverage
- Keep TestCases HostApp on iossimulator-arm64; net12 iOS rejects x64
- Build Android and iOS Mono device tests in separate stages
- Re-enable Debug CoreCLR sample-content integration test
- Enable macOSTemplates, iOS Mono lanes and remaining Apple template tests
- Log workload manifest state before Windows device-test builds
- Fix iOS Mono integration-test lanes on .NET 12 SDK
- Keep both iOS simulator RIDs for the net11 HostApp on CI
- Shut down build servers before Windows device-test builds
- Reconcile Windows Switch hover state with upstream dotnet#40209
- Re-enable Avalonia template tests and fix previous Apple TFMs
- [net12][ci] Remove .NET 12 Mono and iossimulator-x64 coverage
- [net12][tests] Isolate Android debug keystore per integration test
- Keep PSHOME last in persisted macOS PATH
- [ci] Require the exact iOS simulator runtime and accept already-installed runtimes
- [ci] Keep the simulator provisioning contract with exact runtime checks
- [ci] Select Xcode 27.1 for .NET 12 Apple builds where agents have it
- [ci] Keep iOS UI test execution on the pinned Xcode
- [ci] Provision simulator runtimes for the Xcode actually selected
- [ci] Require the exact iOS simulator runtime and accept already-installed runtimes (dotnet#40407)
- Restore .NET 12 dependency versions and provisioning after rebasing onto net11
- Make Issue2951Test re-query buttons after taps

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit to kubaflo/maui that referenced this pull request Nov 24, 2026
Rebased onto latest main via net11 (b8cc4e7, which contains main d4ae6c2). The PR diff is unchanged; previous head 7494403 squashed these commits:

- Move main to .NET 12
- Skip the net12 Apple scene-manifest validation for repo samples and test apps
- Provision JDK 21 for the .NET 12 Android workload
- Publish Helix xUnit payloads for the repo TFM
- Drop the iossimulator-x64 RID, which net12 iOS no longer ships
- Expect assembly version 12 in AssemblyInfoTests
- Use MAUI 11 rc.2 as the previous MauiVersion in integration tests
- Retry JDK provisioning with a longer backoff
- Run one iOS integration lane on the xcode-27 image
- Revert "Run one iOS integration lane on the xcode-27 image"
- Always use iossimulator-arm64 in integration tests
- Skip iOS runtimes XHarness can't create a simulator on
- Fix Windows CI on the .NET 12 preview SDK
- Skip .NET 12 iOS in public CI
- Make the device-test Mono lane iOS-only
- [ci] Restore public iOS coverage
- Fix iOS test host and migration validation
- Restore previous-framework Apple integration coverage
- Isolate Android test hosts from Apple builds
- Fix Android CoreCLR device test failures
- Select the pinned internal Xcode package
- Pass UI build arguments without expression evaluation
- Restore iOS device-test runner scene lifecycle
- Key Windows Switch hover state by ToggleSwitch
- Wait for asynchronous Android CoreCLR GC bridge release in device-test GC helper
- Restore Android Mono and iOS simulator-x64 test coverage
- Keep TestCases HostApp on iossimulator-arm64; net12 iOS rejects x64
- Build Android and iOS Mono device tests in separate stages
- Re-enable Debug CoreCLR sample-content integration test
- Enable macOSTemplates, iOS Mono lanes and remaining Apple template tests
- Log workload manifest state before Windows device-test builds
- Fix iOS Mono integration-test lanes on .NET 12 SDK
- Keep both iOS simulator RIDs for the net11 HostApp on CI
- Shut down build servers before Windows device-test builds
- Reconcile Windows Switch hover state with upstream dotnet#40209
- Re-enable Avalonia template tests and fix previous Apple TFMs
- [net12][ci] Remove .NET 12 Mono and iossimulator-x64 coverage
- [net12][tests] Isolate Android debug keystore per integration test
- Keep PSHOME last in persisted macOS PATH
- [ci] Require the exact iOS simulator runtime and accept already-installed runtimes
- [ci] Keep the simulator provisioning contract with exact runtime checks
- [ci] Select Xcode 27.1 for .NET 12 Apple builds where agents have it
- [ci] Keep iOS UI test execution on the pinned Xcode
- [ci] Provision simulator runtimes for the Xcode actually selected
- [ci] Require the exact iOS simulator runtime and accept already-installed runtimes (dotnet#40407)
- Restore .NET 12 dependency versions and provisioning after rebasing onto net11
- Make Issue2951Test re-query buttons after taps

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@kubaflo kubaflo added this to the .NET 11 SR2 milestone Nov 24, 2026
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
…lled runtimes (dotnet#40407)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

Fixes the "Install Simulator Runtimes" step in
`eng/pipelines/common/provision.yml`, which fails on the updated
`ACES_VM_SharedPool_GoldenGate` image (Xcode 27.0/27.1/27.2).

**Problem**
- `xcodebuild -downloadPlatform iOS -buildVersion 27.2` prints "iOS 27.2
(arm64Only) is already downloaded." and exits **70** when the runtime is
installed. The step treated any non-zero exit as a wedged
CoreSimulatorService, deleted **all** runtimes and downloaded again.
- `-buildVersion 27.2` is ambiguous: it returns 24B114, 24B8117,
24B91014 or 24B91016s. 24B91014/24B91016s register as
`com.apple.CoreSimulator.SimRuntime.iOS-27-2-iPhone19-4`. XHarness looks
for exactly `iOS-27-2`, so RunOniOS fails either in the smoke test
(`simctl create` → SimError 403 "Incompatible device") or at boot
("Simulator failed to fully boot… UDID:" empty).
- On maui-pr (iOS 27.0) every job hits the same exit-70 path and
re-downloads the 8 GB runtime needlessly; it recovers only because 27.0
has one build.

**Fix**
- New `required_runtime_create_usable` helper: requires the exact
`iOS-MAJOR-MINOR` runtime to be available and `simctl create`-usable
with an iPhone device type that runtime supports (prefers iPhone-11-Pro,
which XHarness uses).
- "is already downloaded." (or exit 0) + usable exact runtime → done; no
deletion, no re-download.
- Recovery/retry loop uses the same helper, so a device-specific build
no longer ends the loop; it retries until the plain runtime is
installed.
- Final verification no longer counts device-specific runtimes via the
platform+version fallback.

**Evidence**
- dotnet-maui-build 3139948 RunOniOS_MauiNativeAOT (log 1356): "already
downloaded" → exit 70 → delete → 24B91014 ×3, 24B91016s → "Incompatible
device" ×5 → step failed.
- Same build: job with only 24B91014 passed install but failed tests
(empty UDID); jobs with 24B114 / 24B8117 passed.
- maui-pr 1687937: all 19 install steps printed "iOS 27.0 (arm64Only) is
already downloaded.", exited 70 and re-downloaded 24A434.

**Validation**
- YAML parse and `bash -n` of the extracted step script: passed.
- Helper against mocked `simctl` JSON: variant-only → fails (rc=1);
generic + iPhone-11-Pro → picks iPhone-11-Pro; generic without
iPhone-11-Pro → falls back to its supported iPhone.
- Helper against real local simctl (Xcode 27.2): iOS 26.5 usable
(iPhone-11-Pro), iOS 27.1 usable (iPhone-Duo, the only supported
iPhone), iOS 27.2 not installed → rc=1; smoke devices cleaned up.
- Final-verification jq: real 26.5 → 1; injected `iOS-27-2-iPhone19-4`
only → 0.
- Real CI run on GoldenGate pending (this PR's CI).

### Issues Fixed

No issue filed; reported against the GoldenGate image rollout
(dotnet-maui-build 3139948).

---------
kubaflo added a commit that referenced this pull request Nov 28, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

This is test infrastructure for the .NET 12 (`main`) line, so it targets
`main`.

### Description of Change

Migrate all repository test execution from **Helix + XHarness** to plain
**`dotnet test`** on **Microsoft.Testing.Platform (MTP)**.

This PR carries the migration from #39918 (by @mattleibow, commits
preserved) brought up to date with current `main` (.NET 12 SDK, `/review
run-device-tests`, recent product and test fixes), plus the follow-up
fixes needed to make it build and pass on .NET 12.

#### Why we need this

- **One way to run tests, everywhere.** Today unit tests run through
Arcade's Helix SDK (`eng/helix.proj`), device tests through Helix +
XHarness (`eng/helix_xharness.proj`), Appium tests through Cake, and
locally through yet other scripts. After this change the same command —
`dotnet test --project <test project>` (plus `--device` for mobile) —
runs every suite on a developer machine, in CI, and in the Copilot
review gate. A CI failure can be reproduced locally with the exact
command CI used.
- **Remove a fragile, opaque layer.** Helix/XHarness add payload
zipping, remote queues, a job monitor, custom work-item scripts and a
separate result path. Many recurring device-test infra failures
(XHarness exit 78/80/83 `APP_LAUNCH_FAILURE`/`APP_CRASH`, Helix jobs
never scheduled, stale or missing `testResults.xml`, queue/image drift
such as XHarness requiring an iPhone 11 Pro device type that iOS 27.1+
no longer ships) come from that layer, not from MAUI. Direct execution
on the agent gives real logs, real exit codes and the actual device in
the job.
- **Genuine, trustworthy results.** Every suite now produces the test
framework's own TRX via MTP (`--report-trx`), and empty selections or
missing reports fail the job instead of silently passing. On Android/iOS
the native app's own TRX is collected and reconciled with the host
proxy, so a crash cannot be reported as a pass.
- **Modern test stack.** xUnit v2 + VSTest + XHarness test runners are
replaced by **xUnit v3 + MTP**, which is what the .NET SDK `dotnet test`
and device (`--device`) support is built on. This unblocks newer xUnit
features (`TestContext`, cancellation, `Assert.Skip*`) and keeps us on
the path the SDK supports directly.
- **Fewer moving parts to maintain.** Removes `eng/helix.proj`,
`eng/helix_xharness.proj`, the Helix pipeline stages, the XHarness CLI
tool, and the XHarness/Helix package dependencies.

#### What changes

- **Unit tests**: all repository xUnit suites move to xUnit v3 (`4.0.2`)
on MTP (`2.5.1`); `global.json` selects `Microsoft.Testing.Platform` as
the `dotnet test` runner. CI (`stage-unit-tests.yml`) runs each project
with `dotnet test --project … --report-trx` on Windows and macOS (Debug
and Release) and validates the TRX
(`eng/scripts/Assert-TestResults.ps1`). Helix unit-test stages are
removed.
- **Device tests** (Controls, Core, Graphics, Essentials,
BlazorWebView): the XHarness/visual runners are replaced by native MTP
hosts — Android instrumentation, the normal Apple MAUI app/scene
lifecycle, and an owned Windows MSIX/unpackaged launcher.
`maui-pr-devicetests` runs them directly on device-capable agents
(`stage-device-tests.yml`, `device-tests-steps.yml`) with job-owned
emulators/simulators.
- **UI tests (Appium)** stay on NUnit, now hosted on MTP with matching
fixture-failure, retry and attachment handling.
- **Integration tests** run with `dotnet test`; legacy `--filter`
selectors are translated to MTP filters. iOS template apps are launched
with `simctl` on a dedicated simulator instead of XHarness.
- **Local tooling** (`Run-DeviceTests.ps1`, Cake, review-gate scripts,
skills/instructions) updated to the same direct commands.

#### Changes made while bringing #39918 onto current `main`

- Merged `main` (.NET 12 move #40060, `/review run-device-tests` #40545,
review-gate removal #40595, and other fixes) and resolved 23 conflicts.
- **`/review run-device-tests` selection ported** to the direct
template: `ci-device-tests.yml` passes
`selectedRun`/`selectedPlatforms`/`selectedProjects`/`selectedFilters`,
and `stage-device-tests.yml` runs only the selected platforms and
projects with the selected category skip-lists. Verified with the AzDO
YAML preview API (full run: 28 jobs; a sample selection of Android+iOS /
Controls+Essentials with `SkipCategories=Shell,Label`: exactly 4 jobs
with that filter). `eng/helix_xharness.proj` is no longer a trusted
dispatch path.
- **Device tests default to `net12.0` and CoreCLR only** — the .NET 12
mobile workloads no longer provide Mono (same as #40060).
- Took main's Switch hover-resource fix (#40209) over the PR's earlier
variant; kept the HybridWebView asset-ownership change together with
main's `DynamicDependency`.
- Ported main's UI-test retry recovery rules (#40407) into the shared
`UITestRetry.cs` used by Cake and MTP.
- Dropped the XHarness-only simulator runtime selection
(`SelectLatestIOSVersion`) and its tests; runtime/device-type selection
is covered by `SimulatorTests`.

#### Fixes found by running CI / locally after the merge

- **xUnit v3 adaptation of tests added on `main`**:
`TestContext.Current.CancellationToken` (xUnit1051), source-info
constructor for `WindowsFact` (xUnit3003); `UITest.NUnit.Tests` and the
Windows launcher build for the repo TFM instead of `net11.0`.
- **Async-void / inline continuation differences in xUnit v3** (v2's
`AsyncTestSyncContext` hid them):
- `ListProxyTests.SynchronizedCollectionAdd` leaked thread-static
dispatcher options onto a thread-pool thread, so later tests got a
dispatcher that always required dispatch (68 Storyboard failures in
macOS Release). Restored after use; fixtures reset the options.
- Shell tests resumed inline from `Navigated`, so the *next* tests ran
inside Shell's navigation callback and had their implicit routes reset
(`DeferPopNavigation(Pop)`). Verified locally by detecting
`FireNavigatedEvents` on the next test's stack before/after the change.
- **Native runner thread affinity** (test bodies run on the thread pool,
not the UI thread as under XHarness):
`WillTerminateDestroysMainPageWindowOnce` resolved the `Application` off
the UI thread; the CarouselView leak test posted a UIKit notification
off the UI thread.
- **iOS simulator selection**: only use device types that the runtime
lists (device-specific iOS 27.1 builds only accept one, causing
`SimError 403 Incompatible device`), and prefer the iPhone 11 Pro
profile XHarness used (Shell flyout header geometry tests from #39877
fail on Dynamic Island phones; passes on iPhone 11 Pro, fails on iPhone
16 — reproduced locally).
- **Mac Catalyst**: `dotnet test` starts the app executable directly, so
unlike `open`/XHarness it isn't activated; activate it before running
(animated CarouselView scrolls intermittently never finished).
- **Integration tests**: shut down build servers after installing the
test workloads — reused MSBuild nodes kept a stale workload resolver and
nested `UseWorkload=true` sample builds failed with NU1015 (reproduced
locally; Samples macOS now passes in CI). The Android `maui-blazor` +
`TrimMode=full` row is skipped explicitly: the previous runner silently
dropped `TrimMode`, and Blazor does not support full trimming
(dotnet/aspnetcore#63951).
- **Windows `HybridWebView` disconnect** NRE when `CoreWebView2` is not
(or no longer) initialized — exposed by the new fixture teardown that
disconnects every handler.
- Docs spellcheck word, and a template boolean comparison so the device
stage doesn't expand to zero jobs.
- **UI-test retry reconciliation**: when a fixture's `OneTimeSetUp`
fails, NUnit reports its `[Ignore]`d tests as failed and the retry
reports them skipped. MTP's TRX names classes of fixtures with arguments
(every UI-test fixture, e.g. `EditorFeatureTests(Windows)`) by namespace
only, so the ignored tests were never matched as recovered and the job
failed although the retry passed. Replaying the real CI TRX/NUnit
reports reproduces the failure before the fix and merges cleanly after
it; `FixtureRecoveryReconcilesIgnoredTestsInParameterizedFixtures`
covers it.
- **iOS CarouselView test timing** (`Animated ScrollTo Does Not Report
Positions It Passes Over`, failed on every native CI run, passed under
Helix): with logging, every failing run showed a still-queued
initial-position pass scrolling back to page 0 without animation,
cancelling the test's animated `ScrollTo`. Under the native runner the
test can resume between those queued passes. The test now lets them
drain; full-class cold runs went from 2/9 failing to 5/5 passing, and it
passes in CI.
- **`main` build breaks from re-enabled CA1416** (#40663): carried the
fixes from #40708 (merged) and #40720
(`UISettings.AnimationsEnabledChanged` in `PlatformTicker` and
`MotionPolicy` requires Windows 10.0.19041). The Windows errors only
surfaced one project at a time because `Core` references `Essentials`.

### Validation

Local (macOS arm64, .NET SDK `12.0.100-alpha.1.26523.103`, Debug,
`dotnet test --project <csproj> --report-trx`):

| Project | Result |
| --- | --- |
| Controls.Xaml.UnitTests | 2,327 passed, 8 skipped |
| Controls.Core.UnitTests | 7,453 passed, 30 skipped |
| Controls.BindingSourceGen.UnitTests | 135 passed |
| SourceGen.UnitTests | 997 passed |
| Core.UnitTests | 1,147 passed |
| Resizetizer.UnitTests | 795 passed, 3 skipped |
| Essentials.UnitTests | 520 passed |
| Essentials.ExternalBackend.UnitTests | 6 passed |
| Graphics.Tests | 406 passed |
| VisualTestUtils.MagickNet.Tests | 13 passed |
| MauiBlazorWebView.UnitTests | 70 passed |
| MauiBlazorWebView.ExternalHandler.UnitTests | 52 passed |
| UITest.NUnit.Tests | 50 passed, 5 skipped |
| TestUtils.UnitTests | 61 passed, 1 skipped |

Pester (pipeline/runner scripts): `Direct-TestDevice`, `Cake-Mtp`,
`RunTests`, `NUnitMtp`, `XunitMtp`, `Run-DeviceTests`,
`WindowsTestPackage`, `Assert-TestResults`, `CopilotPipeline`,
`Review-PR`, `Verify-TestsFail`, `BuildAndRunHostApp`, `Review-Tests`,
`Recover-MissedReviewCommands`: 600+ passed. The only remaining failure
(`handles qualified selections in every stage guard`, expects 10 vs 11)
also fails on `main` and is unrelated.

Note:
`StoryboardTests.StoppingFromPropertyChangingDuringATakeoverRaisesOnePairOfNotifications`
(added on `main`) is culture-sensitive and fails under a comma-decimal
locale on `main` as well; it passes under `en-US` as in CI.

#### CI

Every pipeline was run with `/azp run` on this PR and on validation-only
drafts:
- #40703: this PR's changes on `net11`.
- #40705: the #40703 changes plus sample PRs #40696, #40660, #40654 and
#40691, to check that tests added by other PRs run under the native
runners.
- #40706: this PR plus sample PR #40669.

Failures were compared against `main`/`net11` Helix baselines by test
name.

| Pipeline | This PR (`main`) | `net11` validation (#40703 / #40705) |
| --- | --- | --- |
| `maui-pr` (build, pack, unit tests, integration) | ✅ 35/35 jobs (with
the CA1416 fixes) | ✅ 33/33 jobs |
| `maui-pr-devicetests` | ✅ Android, iOS, Mac Catalyst except
`PageTransitions` tests that fail identically in `main`'s Helix runs | ✅
Android, iOS, Mac Catalyst; only intermittent single-test failures that
don't repeat across runs |
| `maui-pr-uitests` (Appium on MTP) | ✅ 133/134 jobs; the only failure,
WinUI `SharedElementLandsAndSourceIsRestoredAfterPop`, also fails on
`main`'s Helix runs | ✅ 130/133; see below |

Remaining UI-test failures on `net11`, none of them regressions:
- `DragAndDropWithAnElementThatIsRemoved` (Mac Catalyst) fails in 2 of
the last 10 `net11` Helix runs too.
- The RefreshView tests failed only on #40705, which includes
RefreshView sample PR #40660.
- The `vlatest` shard failed because the agent couldn't download the iOS
18.5 simulator runtime.
- Material3 (API 36) screenshots in the last two runs came out 87 px
taller. #40603, merged on `net11` yesterday, now crops by the status-bar
height that Appium reports. The same tree and emulator setup passed
430/433 in the two previous runs.

**Known remaining device-test blockers (from #39918, not regressions of
this merge):** packaged Windows MSIX installation is rejected with
`0x800B0109` (the temporary signer is not a trusted root on the agent
image — needs owner-provided signing/provisioning), and the Windows
Controls unpackaged suite can terminate with `0xDEAD` after ~350 tests
(native composition resource exhaustion investigated in #39918).

### Issues Fixed

No product issue. Supersedes/continues #39918.

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 28, 2026
…[net11]

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

This is test infrastructure for the .NET 12 (`main`) line, so it targets
`main`.

Migrate all repository test execution from **Helix + XHarness** to plain
**`dotnet test`** on **Microsoft.Testing.Platform (MTP)**.

This PR carries the migration from #39918 (by @mattleibow, commits
preserved) brought up to date with current `main` (.NET 12 SDK, `/review
run-device-tests`, recent product and test fixes), plus the follow-up
fixes needed to make it build and pass on .NET 12.

- **One way to run tests, everywhere.** Today unit tests run through
Arcade's Helix SDK (`eng/helix.proj`), device tests through Helix +
XHarness (`eng/helix_xharness.proj`), Appium tests through Cake, and
locally through yet other scripts. After this change the same command —
`dotnet test --project <test project>` (plus `--device` for mobile) —
runs every suite on a developer machine, in CI, and in the Copilot
review gate. A CI failure can be reproduced locally with the exact
command CI used.
- **Remove a fragile, opaque layer.** Helix/XHarness add payload
zipping, remote queues, a job monitor, custom work-item scripts and a
separate result path. Many recurring device-test infra failures
(XHarness exit 78/80/83 `APP_LAUNCH_FAILURE`/`APP_CRASH`, Helix jobs
never scheduled, stale or missing `testResults.xml`, queue/image drift
such as XHarness requiring an iPhone 11 Pro device type that iOS 27.1+
no longer ships) come from that layer, not from MAUI. Direct execution
on the agent gives real logs, real exit codes and the actual device in
the job.
- **Genuine, trustworthy results.** Every suite now produces the test
framework's own TRX via MTP (`--report-trx`), and empty selections or
missing reports fail the job instead of silently passing. On Android/iOS
the native app's own TRX is collected and reconciled with the host
proxy, so a crash cannot be reported as a pass.
- **Modern test stack.** xUnit v2 + VSTest + XHarness test runners are
replaced by **xUnit v3 + MTP**, which is what the .NET SDK `dotnet test`
and device (`--device`) support is built on. This unblocks newer xUnit
features (`TestContext`, cancellation, `Assert.Skip*`) and keeps us on
the path the SDK supports directly.
- **Fewer moving parts to maintain.** Removes `eng/helix.proj`,
`eng/helix_xharness.proj`, the Helix pipeline stages, the XHarness CLI
tool, and the XHarness/Helix package dependencies.

- **Unit tests**: all repository xUnit suites move to xUnit v3 (`4.0.2`)
on MTP (`2.5.1`); `global.json` selects `Microsoft.Testing.Platform` as
the `dotnet test` runner. CI (`stage-unit-tests.yml`) runs each project
with `dotnet test --project … --report-trx` on Windows and macOS (Debug
and Release) and validates the TRX
(`eng/scripts/Assert-TestResults.ps1`). Helix unit-test stages are
removed.
- **Device tests** (Controls, Core, Graphics, Essentials,
BlazorWebView): the XHarness/visual runners are replaced by native MTP
hosts — Android instrumentation, the normal Apple MAUI app/scene
lifecycle, and an owned Windows MSIX/unpackaged launcher.
`maui-pr-devicetests` runs them directly on device-capable agents
(`stage-device-tests.yml`, `device-tests-steps.yml`) with job-owned
emulators/simulators.
- **UI tests (Appium)** stay on NUnit, now hosted on MTP with matching
fixture-failure, retry and attachment handling.
- **Integration tests** run with `dotnet test`; legacy `--filter`
selectors are translated to MTP filters. iOS template apps are launched
with `simctl` on a dedicated simulator instead of XHarness.
- **Local tooling** (`Run-DeviceTests.ps1`, Cake, review-gate scripts,
skills/instructions) updated to the same direct commands.

- Merged `main` (.NET 12 move #40060, `/review run-device-tests` #40545,
review-gate removal #40595, and other fixes) and resolved 23 conflicts.
- **`/review run-device-tests` selection ported** to the direct
template: `ci-device-tests.yml` passes
`selectedRun`/`selectedPlatforms`/`selectedProjects`/`selectedFilters`,
and `stage-device-tests.yml` runs only the selected platforms and
projects with the selected category skip-lists. Verified with the AzDO
YAML preview API (full run: 28 jobs; a sample selection of Android+iOS /
Controls+Essentials with `SkipCategories=Shell,Label`: exactly 4 jobs
with that filter). `eng/helix_xharness.proj` is no longer a trusted
dispatch path.
- **Device tests default to `net12.0` and CoreCLR only** — the .NET 12
mobile workloads no longer provide Mono (same as #40060).
- Took main's Switch hover-resource fix (#40209) over the PR's earlier
variant; kept the HybridWebView asset-ownership change together with
main's `DynamicDependency`.
- Ported main's UI-test retry recovery rules (#40407) into the shared
`UITestRetry.cs` used by Cake and MTP.
- Dropped the XHarness-only simulator runtime selection
(`SelectLatestIOSVersion`) and its tests; runtime/device-type selection
is covered by `SimulatorTests`.

- **xUnit v3 adaptation of tests added on `main`**:
`TestContext.Current.CancellationToken` (xUnit1051), source-info
constructor for `WindowsFact` (xUnit3003); `UITest.NUnit.Tests` and the
Windows launcher build for the repo TFM instead of `net11.0`.
- **Async-void / inline continuation differences in xUnit v3** (v2's
`AsyncTestSyncContext` hid them):
- `ListProxyTests.SynchronizedCollectionAdd` leaked thread-static
dispatcher options onto a thread-pool thread, so later tests got a
dispatcher that always required dispatch (68 Storyboard failures in
macOS Release). Restored after use; fixtures reset the options.
- Shell tests resumed inline from `Navigated`, so the *next* tests ran
inside Shell's navigation callback and had their implicit routes reset
(`DeferPopNavigation(Pop)`). Verified locally by detecting
`FireNavigatedEvents` on the next test's stack before/after the change.
- **Native runner thread affinity** (test bodies run on the thread pool,
not the UI thread as under XHarness):
`WillTerminateDestroysMainPageWindowOnce` resolved the `Application` off
the UI thread; the CarouselView leak test posted a UIKit notification
off the UI thread.
- **iOS simulator selection**: only use device types that the runtime
lists (device-specific iOS 27.1 builds only accept one, causing
`SimError 403 Incompatible device`), and prefer the iPhone 11 Pro
profile XHarness used (Shell flyout header geometry tests from #39877
fail on Dynamic Island phones; passes on iPhone 11 Pro, fails on iPhone
16 — reproduced locally).
- **Mac Catalyst**: `dotnet test` starts the app executable directly, so
unlike `open`/XHarness it isn't activated; activate it before running
(animated CarouselView scrolls intermittently never finished).
- **Integration tests**: shut down build servers after installing the
test workloads — reused MSBuild nodes kept a stale workload resolver and
nested `UseWorkload=true` sample builds failed with NU1015 (reproduced
locally; Samples macOS now passes in CI). The Android `maui-blazor` +
`TrimMode=full` row is skipped explicitly: the previous runner silently
dropped `TrimMode`, and Blazor does not support full trimming
(dotnet/aspnetcore#63951).
- **Windows `HybridWebView` disconnect** NRE when `CoreWebView2` is not
(or no longer) initialized — exposed by the new fixture teardown that
disconnects every handler.
- Docs spellcheck word, and a template boolean comparison so the device
stage doesn't expand to zero jobs.
- **UI-test retry reconciliation**: when a fixture's `OneTimeSetUp`
fails, NUnit reports its `[Ignore]`d tests as failed and the retry
reports them skipped. MTP's TRX names classes of fixtures with arguments
(every UI-test fixture, e.g. `EditorFeatureTests(Windows)`) by namespace
only, so the ignored tests were never matched as recovered and the job
failed although the retry passed. Replaying the real CI TRX/NUnit
reports reproduces the failure before the fix and merges cleanly after
it; `FixtureRecoveryReconcilesIgnoredTestsInParameterizedFixtures`
covers it.
- **iOS CarouselView test timing** (`Animated ScrollTo Does Not Report
Positions It Passes Over`, failed on every native CI run, passed under
Helix): with logging, every failing run showed a still-queued
initial-position pass scrolling back to page 0 without animation,
cancelling the test's animated `ScrollTo`. Under the native runner the
test can resume between those queued passes. The test now lets them
drain; full-class cold runs went from 2/9 failing to 5/5 passing, and it
passes in CI.
- **`main` build breaks from re-enabled CA1416** (#40663): carried the
fixes from #40708 (merged) and #40720
(`UISettings.AnimationsEnabledChanged` in `PlatformTicker` and
`MotionPolicy` requires Windows 10.0.19041). The Windows errors only
surfaced one project at a time because `Core` references `Essentials`.

Local (macOS arm64, .NET SDK `12.0.100-alpha.1.26523.103`, Debug,
`dotnet test --project <csproj> --report-trx`):

| Project | Result |
| --- | --- |
| Controls.Xaml.UnitTests | 2,327 passed, 8 skipped |
| Controls.Core.UnitTests | 7,453 passed, 30 skipped |
| Controls.BindingSourceGen.UnitTests | 135 passed |
| SourceGen.UnitTests | 997 passed |
| Core.UnitTests | 1,147 passed |
| Resizetizer.UnitTests | 795 passed, 3 skipped |
| Essentials.UnitTests | 520 passed |
| Essentials.ExternalBackend.UnitTests | 6 passed |
| Graphics.Tests | 406 passed |
| VisualTestUtils.MagickNet.Tests | 13 passed |
| MauiBlazorWebView.UnitTests | 70 passed |
| MauiBlazorWebView.ExternalHandler.UnitTests | 52 passed |
| UITest.NUnit.Tests | 50 passed, 5 skipped |
| TestUtils.UnitTests | 61 passed, 1 skipped |

Pester (pipeline/runner scripts): `Direct-TestDevice`, `Cake-Mtp`,
`RunTests`, `NUnitMtp`, `XunitMtp`, `Run-DeviceTests`,
`WindowsTestPackage`, `Assert-TestResults`, `CopilotPipeline`,
`Review-PR`, `Verify-TestsFail`, `BuildAndRunHostApp`, `Review-Tests`,
`Recover-MissedReviewCommands`: 600+ passed. The only remaining failure
(`handles qualified selections in every stage guard`, expects 10 vs 11)
also fails on `main` and is unrelated.

Note:
`StoryboardTests.StoppingFromPropertyChangingDuringATakeoverRaisesOnePairOfNotifications`
(added on `main`) is culture-sensitive and fails under a comma-decimal
locale on `main` as well; it passes under `en-US` as in CI.

Every pipeline was run with `/azp run` on this PR and on validation-only
drafts:
- #40703: this PR's changes on `net11`.
- #40705: the #40703 changes plus sample PRs #40696, #40660, #40654 and
runners.
- #40706: this PR plus sample PR #40669.

Failures were compared against `main`/`net11` Helix baselines by test
name.

| Pipeline | This PR (`main`) | `net11` validation (#40703 / #40705) |
| --- | --- | --- |
| `maui-pr` (build, pack, unit tests, integration) | ✅ 35/35 jobs (with
the CA1416 fixes) | ✅ 33/33 jobs |
| `maui-pr-devicetests` | ✅ Android, iOS, Mac Catalyst except
`PageTransitions` tests that fail identically in `main`'s Helix runs | ✅
Android, iOS, Mac Catalyst; only intermittent single-test failures that
don't repeat across runs |
| `maui-pr-uitests` (Appium on MTP) | ✅ 133/134 jobs; the only failure,
WinUI `SharedElementLandsAndSourceIsRestoredAfterPop`, also fails on
`main`'s Helix runs | ✅ 130/133; see below |

Remaining UI-test failures on `net11`, none of them regressions:
- `DragAndDropWithAnElementThatIsRemoved` (Mac Catalyst) fails in 2 of
the last 10 `net11` Helix runs too.
- The RefreshView tests failed only on #40705, which includes
RefreshView sample PR #40660.
- The `vlatest` shard failed because the agent couldn't download the iOS
18.5 simulator runtime.
- Material3 (API 36) screenshots in the last two runs came out 87 px
taller. #40603, merged on `net11` yesterday, now crops by the status-bar
height that Appium reports. The same tree and emulator setup passed
430/433 in the two previous runs.

**Known remaining device-test blockers (from #39918, not regressions of
this merge):** packaged Windows MSIX installation is rejected with
`0x800B0109` (the temporary signer is not a trusted root on the agent
image — needs owner-provided signing/provisioning), and the Windows
Controls unpackaged suite can terminate with `0xDEAD` after ~350 tests
(native composition resource exhaustion investigated in #39918).

No product issue. Supersedes/continues #39918.

---------

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
(cherry picked from commit b5108cd)

net11 adaptation: net11.0 TFM, CoreCLR + Mono device-test runtimes and net11's Arcade SDK version, matching validation PR #40703. SourceGen tests for .NET 12-only features are not brought over.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 28, 2026
…#40766)

<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

<!--
Open .NET 11 fix PRs against net11 for review; target main for
next-major features.
After approval, a maintainer manually retargets the fix PR to the active
inflight
branch and merges it directly there. Do not merge individual fixes into
net11.
Bots must not retarget or merge. Candidate integration into net11 and
release/*
changes are separate, explicitly coordinated release work.
-->

### Target Branch

| This PR is for | Initial base |
| --- | --- |
| New features, API changes, or .NET 12 work (including .NET 12 fixes) |
`main` |
| .NET 11 servicing fixes | `net11`, for review |
| Older servicing, release integration, infrastructure, or documentation
| The branch designated for that work |

- [x] I selected the applicable base branch using the [contribution
guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting).

For .NET 11 fixes, only a maintainer retargets the approved PR to the
active
inflight lane and merges it after CI validates that final base. Do not
merge
individual fixes directly into `net11`; agents must not retarget or
merge.

### Description of Change

<!-- Enter description of the fix in this section -->

Fix the iOS UI-test `vlatest` lane without changing the pinned `v18.5`
lane.

In [main build
1703706](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1703706),
three CoreCLR `vlatest` groups (CollectionView3, Cells/CheckBox,
Lifecycle/ManualReview/Maps) failed setup five times before executing
tests: `No installed iOS simulator runtime matches ios-simulator-64`.
Their command lines requested `--apiversion=18.5`, while those agents
only had iOS 26.x installed.

The CoreCLR matrix hard-coded `18.5` for `latest`
(`eng/pipelines/common/ui-tests.yml`, formerly line 462), and NativeAOT
similarly substituted `defaultiOSVersion`. After #40661, `GetUDID` uses
this API-version argument for an unsuffixed simulator selector, making
that substitution an actual runtime requirement rather than merely
Appium metadata.

- Pass the matrix's literal version through in both runtime variants.
The existing Cake resolver already selects the highest available
installed iOS runtime for `latest`.
- Set Appium's `PLATFORM_VERSION` from the selected simulator's actual
runtime. Do not pass the symbolic selector to Appium or misreport the
installed OS.
- Preserve pinned simulator selectors and runtime installation behavior;
do not install a runtime for the latest lane merely to satisfy an
obsolete pin.
- Document the selector semantics in the canonical CI facts.

Searched open and recently merged upstream PRs before implementing.
#40407 concerns exact runtime provisioning; it does not fix this matrix
substitution. No existing fix found.

#### Validation

- `python3` with `yaml.safe_load` on
`eng/pipelines/common/ui-tests.yml`,
`eng/pipelines/common/ui-tests-steps.yml`, and
`eng/pipelines/ci-uitests.yml`: **passed**.
- `DOTNET_ROLL_FORWARD=Major dotnet exec
/Users/kubaflo/.nuget/packages/cake.tool/7.0.0/tools/net10.0/any/Cake.dll
eng/devices/ios.cake --target=uitest-prepare --apiversion=latest
--dryrun --verbosity=quiet`: **passed**.
- Read-only Cake diagnostic target using the actual
`FindSimulatorRuntime` method and changed Appium-version block, against
`xcrun simctl list runtimes --json` / `xcrun simctl list --json`, with
`--boot=false`: **passed**. Installed iOS versions: 18.5, 26.0, 26.5,
27.1. `latest` → iOS 27.1; pinned `18.5` → iOS 18.5; `min` → iOS 18.5;
Appium platform version → `27.1`. No simulator was created or booted by
the passing diagnostic. Removed the diagnostic script afterwards.
- An initial diagnostic without `--boot=false` resolved the same
runtimes but failed in pre-existing Cake.AppleSimulator teardown (`Could
not locate executable`); rerunning with device boot/cleanup disabled
passed.
- `git diff --check`: **passed**.
- No pipeline tests added, per policy. Full UI suite not run locally;
requesting actual `maui-pr-uitests` validation via `/azp run
maui-pr-uitests` on this PR. CI outcome pending.


### Issues Fixed

<!-- Please make sure that there is a bug logged for the issue being
fixed. The bug should describe the problem and how to reproduce it. -->

No linked issue; fixes the setup failures in main UI-test build 1703706
(logs 4317, 4745, 4332).

### Let AI finish this PR

- [ ] **Let the MAUI agent address review feedback and fix remaining
issues on this PR.** Maintainers still decide whether it is merged. For
PRs from forks, the agent opens a follow-up PR that keeps your commits.

<!--
Verify the target branch follows the release workflow in
docs/ReleaseBranchWorkflow.md.
Infrastructure and documentation changes should target the branch where
they apply.
-->

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

5 participants