Repository navigation
Conversation
SetOrientationLandscape/Portrait return while the iOS rotation is still animating, so ChangeOrientationCheckScroll could read an intermediate MainGrid frame (CenterY 249/251 in CI instead of the settled 411). Poll MainGrid after each rotation until it shows the rotated layout and its rect is unchanged for two consecutive reads, then compare CenterY. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
temporarily deployed
to
copilot-pat-pool
November 23, 2026 13:29 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
kubaflo
temporarily deployed
to
copilot-pat-pool
November 23, 2026 13:29 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
kubaflo
temporarily deployed
to
copilot-pat-pool
November 23, 2026 13:30 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
kubaflo
temporarily deployed
to
copilot-pat-pool
November 23, 2026 13:33 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 23, 2026 13:34 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 23, 2026 13:34 — with
GitHub Actions
Inactive
1 task
Contributor
Author
|
/review expert-review-with-gate |
Contributor
|
Warning Your |
Contributor
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 26fc459.
Contributor
Author
|
/review expert-review-with-gate |
Contributor
|
Warning Your |
Contributor
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 26fc459.
kubaflo
added a commit
that referenced
this pull request
Nov 23, 2026
…40531) <!-- 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 PR targets the SR2 release candidate, `candidate/11.0.1xx-sr2`, because this intermittent failure is the only remaining UI-test failure on #40116 (UI build 1694858 at candidate `e3c8b2ec`). The test is the same on `net11` and `main`, so the change applies there too. 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 change to `Issue2241.ChangeOrientationCheckScroll`. Product code, the host page and the shared Appium helpers are unchanged. **Root cause: the test reads the layout mid-rotation** `App.SetOrientationLandscape()` / `SetOrientationPortrait()` return as soon as the driver accepts the orientation change. They don't wait for the rotation to finish, which on iOS animates for roughly 300–400 ms. The test called `GetRect()` immediately after rotating back to portrait, so it sometimes read an intermediate frame of `MainGrid` instead of the settled layout. - Settled portrait layout: `MainGrid` at y=211 with height 400, so CenterY = **411** (the expected value). - Values seen mid-animation: **249** and **251** in CI; 211–248 locally. In the local failing runs, the page source captured at teardown shows the grid back at x=20, y=211, 335×400 (CenterY 411). The ScrollView layout settles correctly; only the read was early. This is not a product regression. **CI evidence** - UI build 1694858 (candidate `e3c8b2ec`), `Controls (v18.5) ScrollView`, run 47329666: `Expected: 411 But was: 249`, then `251` on the in-job retry. - 421 iOS ScrollView job runs scanned across `main`, `net11`, inflight, candidate and unrelated PRs. The same assertion also failed on candidate build 1684453 (235), #40307 (262) and #40263 (263). It is an intermittent that occurs on every branch at about 1%, not a candidate regression. **Fix** After each rotation, the new `WaitForMainGridToSettle` helper polls `MainGrid` every 100 ms until two conditions hold: 1. The rect shows the rotated layout: wider than portrait after going to landscape, narrower than landscape after going back. 2. The rect has been identical for two consecutive reads. It fails with the last rect if this doesn't happen within 10 s. The assertion itself is unchanged: portrait CenterY before and after the scroll must be equal. **Causal validation (local, iOS 18.5 iPhone Xs simulator — the CI configuration)** `dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj --no-build --filter "Name=ChangeOrientationCheckScroll"`, repeated in a loop with `HEADLESS=true`: | Stage | Test code | Result | Observed CenterY on failure | | --- | --- | --- | --- | | Baseline | original | **6 of 15 failed** | 211, 224, 224, 234, 224, 233 | | Fix | this PR | **20 of 20 passed** | — | | Trigger removed | original + `Thread.Sleep(3000)` after each rotation | **12 of 12 passed** | — | | Fix reverted | original | **9 of 15 failed** | 224, 233, 224, 211, 232, 248, 211, 224, 233 | | Restored | this PR | **15 of 15 passed** | — | Adding only a delay after rotating removes the failure, which confirms the timing cause. The fix doesn't slow the test noticeably: it took about 20 s per run, as before. The test also runs on Android. On an Android API 30 emulator (the CI API level), the fixed test passed 4 of 4 runs (4–7 s each) via `pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform android -TestFilter "Name=ChangeOrientationCheckScroll"`, so the rotation-and-settle wait also holds there. ### Issues Fixed Fixes the intermittent `Issue2241.ChangeOrientationCheckScroll` iOS UI-test failure on #40116. There is no separate issue for it. Related: #2241. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
3 tasks
devanathan-vaithiyanathan
pushed a commit
to devanathan-vaithiyanathan/maui
that referenced
this pull request
Nov 24, 2026
…otnet#40531) <!-- 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 PR targets the SR2 release candidate, `candidate/11.0.1xx-sr2`, because this intermittent failure is the only remaining UI-test failure on dotnet#40116 (UI build 1694858 at candidate `e3c8b2ec`). The test is the same on `net11` and `main`, so the change applies there too. 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 change to `Issue2241.ChangeOrientationCheckScroll`. Product code, the host page and the shared Appium helpers are unchanged. **Root cause: the test reads the layout mid-rotation** `App.SetOrientationLandscape()` / `SetOrientationPortrait()` return as soon as the driver accepts the orientation change. They don't wait for the rotation to finish, which on iOS animates for roughly 300–400 ms. The test called `GetRect()` immediately after rotating back to portrait, so it sometimes read an intermediate frame of `MainGrid` instead of the settled layout. - Settled portrait layout: `MainGrid` at y=211 with height 400, so CenterY = **411** (the expected value). - Values seen mid-animation: **249** and **251** in CI; 211–248 locally. In the local failing runs, the page source captured at teardown shows the grid back at x=20, y=211, 335×400 (CenterY 411). The ScrollView layout settles correctly; only the read was early. This is not a product regression. **CI evidence** - UI build 1694858 (candidate `e3c8b2ec`), `Controls (v18.5) ScrollView`, run 47329666: `Expected: 411 But was: 249`, then `251` on the in-job retry. - 421 iOS ScrollView job runs scanned across `main`, `net11`, inflight, candidate and unrelated PRs. The same assertion also failed on candidate build 1684453 (235), dotnet#40307 (262) and dotnet#40263 (263). It is an intermittent that occurs on every branch at about 1%, not a candidate regression. **Fix** After each rotation, the new `WaitForMainGridToSettle` helper polls `MainGrid` every 100 ms until two conditions hold: 1. The rect shows the rotated layout: wider than portrait after going to landscape, narrower than landscape after going back. 2. The rect has been identical for two consecutive reads. It fails with the last rect if this doesn't happen within 10 s. The assertion itself is unchanged: portrait CenterY before and after the scroll must be equal. **Causal validation (local, iOS 18.5 iPhone Xs simulator — the CI configuration)** `dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj --no-build --filter "Name=ChangeOrientationCheckScroll"`, repeated in a loop with `HEADLESS=true`: | Stage | Test code | Result | Observed CenterY on failure | | --- | --- | --- | --- | | Baseline | original | **6 of 15 failed** | 211, 224, 224, 234, 224, 233 | | Fix | this PR | **20 of 20 passed** | — | | Trigger removed | original + `Thread.Sleep(3000)` after each rotation | **12 of 12 passed** | — | | Fix reverted | original | **9 of 15 failed** | 224, 233, 224, 211, 232, 248, 211, 224, 233 | | Restored | this PR | **15 of 15 passed** | — | Adding only a delay after rotating removes the failure, which confirms the timing cause. The fix doesn't slow the test noticeably: it took about 20 s per run, as before. The test also runs on Android. On an Android API 30 emulator (the CI API level), the fixed test passed 4 of 4 runs (4–7 s each) via `pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform android -TestFilter "Name=ChangeOrientationCheckScroll"`, so the rotation-and-settle wait also holds there. ### Issues Fixed Fixes the intermittent `Issue2241.ChangeOrientationCheckScroll` iOS UI-test failure on dotnet#40116. There is no separate issue for it. Related: dotnet#2241. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
KarthikRajaKalaimani
pushed a commit
to KarthikRajaKalaimani/maui
that referenced
this pull request
Nov 26, 2026
…otnet#40531) <!-- 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 PR targets the SR2 release candidate, `candidate/11.0.1xx-sr2`, because this intermittent failure is the only remaining UI-test failure on dotnet#40116 (UI build 1694858 at candidate `e3c8b2ec`). The test is the same on `net11` and `main`, so the change applies there too. 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 change to `Issue2241.ChangeOrientationCheckScroll`. Product code, the host page and the shared Appium helpers are unchanged. **Root cause: the test reads the layout mid-rotation** `App.SetOrientationLandscape()` / `SetOrientationPortrait()` return as soon as the driver accepts the orientation change. They don't wait for the rotation to finish, which on iOS animates for roughly 300–400 ms. The test called `GetRect()` immediately after rotating back to portrait, so it sometimes read an intermediate frame of `MainGrid` instead of the settled layout. - Settled portrait layout: `MainGrid` at y=211 with height 400, so CenterY = **411** (the expected value). - Values seen mid-animation: **249** and **251** in CI; 211–248 locally. In the local failing runs, the page source captured at teardown shows the grid back at x=20, y=211, 335×400 (CenterY 411). The ScrollView layout settles correctly; only the read was early. This is not a product regression. **CI evidence** - UI build 1694858 (candidate `e3c8b2ec`), `Controls (v18.5) ScrollView`, run 47329666: `Expected: 411 But was: 249`, then `251` on the in-job retry. - 421 iOS ScrollView job runs scanned across `main`, `net11`, inflight, candidate and unrelated PRs. The same assertion also failed on candidate build 1684453 (235), dotnet#40307 (262) and dotnet#40263 (263). It is an intermittent that occurs on every branch at about 1%, not a candidate regression. **Fix** After each rotation, the new `WaitForMainGridToSettle` helper polls `MainGrid` every 100 ms until two conditions hold: 1. The rect shows the rotated layout: wider than portrait after going to landscape, narrower than landscape after going back. 2. The rect has been identical for two consecutive reads. It fails with the last rect if this doesn't happen within 10 s. The assertion itself is unchanged: portrait CenterY before and after the scroll must be equal. **Causal validation (local, iOS 18.5 iPhone Xs simulator — the CI configuration)** `dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj --no-build --filter "Name=ChangeOrientationCheckScroll"`, repeated in a loop with `HEADLESS=true`: | Stage | Test code | Result | Observed CenterY on failure | | --- | --- | --- | --- | | Baseline | original | **6 of 15 failed** | 211, 224, 224, 234, 224, 233 | | Fix | this PR | **20 of 20 passed** | — | | Trigger removed | original + `Thread.Sleep(3000)` after each rotation | **12 of 12 passed** | — | | Fix reverted | original | **9 of 15 failed** | 224, 233, 224, 211, 232, 248, 211, 224, 233 | | Restored | this PR | **15 of 15 passed** | — | Adding only a delay after rotating removes the failure, which confirms the timing cause. The fix doesn't slow the test noticeably: it took about 20 s per run, as before. The test also runs on Android. On an Android API 30 emulator (the CI API level), the fixed test passed 4 of 4 runs (4–7 s each) via `pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform android -TestFilter "Name=ChangeOrientationCheckScroll"`, so the rotation-and-settle wait also holds there. ### Issues Fixed Fixes the intermittent `Issue2241.ChangeOrientationCheckScroll` iOS UI-test failure on dotnet#40116. There is no separate issue for it. Related: dotnet#2241. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
mainnet11, for reviewThis PR targets the SR2 release candidate,
candidate/11.0.1xx-sr2, because this intermittent failure is the only remaining UI-test failure on #40116 (UI build 1694858 at candidatee3c8b2ec). The test is the same onnet11andmain, so the change applies there too.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 change to
Issue2241.ChangeOrientationCheckScroll. Product code, the host page and the shared Appium helpers are unchanged.Root cause: the test reads the layout mid-rotation
App.SetOrientationLandscape()/SetOrientationPortrait()return as soon as the driver accepts the orientation change. They don't wait for the rotation to finish, which on iOS animates for roughly 300–400 ms. The test calledGetRect()immediately after rotating back to portrait, so it sometimes read an intermediate frame ofMainGridinstead of the settled layout.MainGridat y=211 with height 400, so CenterY = 411 (the expected value).In the local failing runs, the page source captured at teardown shows the grid back at x=20, y=211, 335×400 (CenterY 411). The ScrollView layout settles correctly; only the read was early. This is not a product regression.
CI evidence
e3c8b2ec),Controls (v18.5) ScrollView, run 47329666:Expected: 411 But was: 249, then251on the in-job retry.main,net11, inflight, candidate and unrelated PRs. The same assertion also failed on candidate build 1684453 (235), [Android] Fix TapGestureRecognizer not firing when a View.Touch handler sets Handled to false #40307 (262) and [SourceGen] Fix xmlns prefix expansion and TypedBinding emission in C# expressions #40263 (263). It is an intermittent that occurs on every branch at about 1%, not a candidate regression.Fix
After each rotation, the new
WaitForMainGridToSettlehelper pollsMainGridevery 100 ms until two conditions hold:It fails with the last rect if this doesn't happen within 10 s. The assertion itself is unchanged: portrait CenterY before and after the scroll must be equal.
Causal validation (local, iOS 18.5 iPhone Xs simulator — the CI configuration)
dotnet test src/Controls/tests/TestCases.iOS.Tests/Controls.TestCases.iOS.Tests.csproj --no-build --filter "Name=ChangeOrientationCheckScroll", repeated in a loop withHEADLESS=true:Thread.Sleep(3000)after each rotationAdding only a delay after rotating removes the failure, which confirms the timing cause. The fix doesn't slow the test noticeably: it took about 20 s per run, as before.
The test also runs on Android. On an Android API 30 emulator (the CI API level), the fixed test passed 4 of 4 runs (4–7 s each) via
pwsh .github/scripts/BuildAndRunHostApp.ps1 -Platform android -TestFilter "Name=ChangeOrientationCheckScroll", so the rotation-and-settle wait also holds there.Issues Fixed
Fixes the intermittent
Issue2241.ChangeOrientationCheckScrolliOS UI-test failure on #40116. There is no separate issue for it. Related: #2241.