Repository navigation
[Testing] Wait for the deferred CarouselView override scroll request on Windows - #40394
Merged
kubaflo merged 1 commit intoNov 18, 2026
Merged
Conversation
CollectionChangePreservesSynchronousCurrentItemOverride asserted the ScrollToRequested count as soon as item 1 was visibly centered. The deferred override first centers the item natively via ScrollIntoView and only requests the final ScrollTo on a later retry pass (>=50 ms later), so the assert depended on the 100 ms poll phase. Wait for the request like the sibling CollectionChangePreservesCurrentItemOverrideFromPositionChanged test does; all existing asserts are unchanged. Temporarily adds DiagnosticSynchronousCurrentItemOverrideRequestOrdering to measure centering vs request ordering in CI; it will be removed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
temporarily deployed
to
copilot-pat-pool
November 18, 2026 20:43 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 18, 2026 20:43 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
kubaflo
temporarily deployed
to
copilot-pat-pool
November 18, 2026 20:45 — with
GitHub Actions
Inactive
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
kubaflo
temporarily deployed
to
copilot-pat-pool
November 18, 2026 20:47 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 18, 2026 20:49 — with
GitHub Actions
Inactive
kubaflo
temporarily deployed
to
copilot-pat-pool
November 18, 2026 20:51 — with
GitHub Actions
Inactive
kubaflo
marked this pull request as ready for review
November 18, 2026 21:20
1 task done
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
…ic (#40395) <!-- 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 a test-only follow-up to #40394, which merged into the SR2 candidate (#40116). 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. No product code changes. #40394 merged into `candidate/11.0.1xx-sr2` (fc55531) while it still contained a temporary diagnostic test, `CarouselViewTests.DiagnosticSynchronousCurrentItemOverrideRequestOrdering`. That test reports its timing measurements through `Assert.Fail`, so it fails on every Windows device run (packaged and unpackaged). This PR deletes that method only. The fix from #40394 stays: the `AssertEventually(() => scrollToRequests == 1, …)` wait in `CollectionChangePreservesSynchronousCurrentItemOverride`. After this PR, the net change from #40394 against the previous candidate head b45b3b4 is just that 4-line wait (`git diff b45b3b4 a8985d9`). ### Issues Fixed Follow-up to #40394. Unblocks Windows device tests on #40116. ### Validation - Roslyn syntax parse of `CarouselViewTests.Windows.cs` (net11.0): 0 diagnostics. A semantic Windows compile and the Windows device run are not possible on this macOS machine. - `git diff b45b3b4 HEAD`: only the 4-line `AssertEventually` addition remains. - Pending: Windows `maui-pr-devicetests` on this PR, to confirm the diagnostic is gone and `CollectionChangePreservesSynchronousCurrentItemOverride` passes in both packaged and unpackaged runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 task
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
…on Windows (#40394) <!-- 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 a test-only fix for a failure on the SR2 candidate #40116. 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. No product code changes. > [!WARNING] > **Draft:** the current head includes a temporary diagnostic test, `DiagnosticSynchronousCurrentItemOverrideRequestOrdering`, which always fails and reports timings. It will be removed in a follow-up commit after Windows device CI records its results. **Symptom.** Candidate device build [1688573](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1688573) (#40116), *Run DeviceTests Windows* (`Controls.DeviceTests-packaged`): `CarouselViewTests.CollectionChangePreservesSynchronousCurrentItemOverride` failed with `Assert.Equal() Failure: Expected: 1, Actual: 0` after 0.54 s. Since 11-13 it failed in 6 of 552 Windows device runs: candidate 1688573, #40361's 1687233, #40288's 1683284, darc-net11 1681785, net11 1680671 and inflight 1680652. The test file is identical on the candidate, `net11` and `main`. **Root cause (test race).** Removing the current item makes `replacement` current, and the test's `CurrentItemChanged` handler overrides it to `override`. Synchronously, the handler sets `Position = 1` and queues the deferred override scroll. In this test, item 1 is not visible yet, so the Low-priority `CompleteCollectionCurrentItemOverrideScroll` does three things: 1. It calls `ScrollIntoView`. Since the viewport width equals the item width, this already centers item 1 natively. 2. It schedules a 50 ms retry. 3. On the retry pass, it sees the item visible, clears the override and calls `ItemsView.ScrollTo(1, Center, animate: false)`. That call raises the counted `ScrollToRequested`. So the visible centering always precedes the counted request by at least 50 ms. The test asserted `scrollToRequests == 1` as soon as `WaitForCenteredPositionAsync` (100 ms poll) observed centering. It passed only when the poll landed after the retry pass. **Fix.** Wait for the request before asserting the count, exactly like the sibling `CollectionChangePreservesCurrentItemOverrideFromPositionChanged` test: ```csharp await AssertEventually(() => scrollToRequests == 1, timeout: 2000, message: "The deferred current-item override did not request its final centered scroll."); ``` Every existing assertion is unchanged, including `Assert.Equal(1, scrollToRequests)` and the Mode/Index/Center/IsAnimated checks, so a duplicate request still fails. No timeout, retry or tolerance changes. ### Issues Fixed Fixes a failing device test on the SR2 candidate (#40116). ### Validation Pending Windows device CI. The evidence will be added here. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 18, 2026
…ic (#40395) <!-- 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 a test-only follow-up to #40394, which merged into the SR2 candidate (#40116). 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. No product code changes. #40394 merged into `candidate/11.0.1xx-sr2` (fc55531) while it still contained a temporary diagnostic test, `CarouselViewTests.DiagnosticSynchronousCurrentItemOverrideRequestOrdering`. That test reports its timing measurements through `Assert.Fail`, so it fails on every Windows device run (packaged and unpackaged). This PR deletes that method only. The fix from #40394 stays: the `AssertEventually(() => scrollToRequests == 1, …)` wait in `CollectionChangePreservesSynchronousCurrentItemOverride`. After this PR, the net change from #40394 against the previous candidate head b45b3b4 is just that 4-line wait (`git diff b45b3b4 a8985d9`). ### Issues Fixed Follow-up to #40394. Unblocks Windows device tests on #40116. ### Validation - Roslyn syntax parse of `CarouselViewTests.Windows.cs` (net11.0): 0 diagnostics. A semantic Windows compile and the Windows device run are not possible on this macOS machine. - `git diff b45b3b4 HEAD`: only the 4-line `AssertEventually` addition remains. - Pending: Windows `maui-pr-devicetests` on this PR, to confirm the diagnostic is gone and `CollectionChangePreservesSynchronousCurrentItemOverride` passes in both packaged and unpackaged runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 19, 2026
…on Windows (#40394) <!-- 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 a test-only fix for a failure on the SR2 candidate #40116. 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. No product code changes. > [!WARNING] > **Draft:** the current head includes a temporary diagnostic test, `DiagnosticSynchronousCurrentItemOverrideRequestOrdering`, which always fails and reports timings. It will be removed in a follow-up commit after Windows device CI records its results. **Symptom.** Candidate device build [1688573](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1688573) (#40116), *Run DeviceTests Windows* (`Controls.DeviceTests-packaged`): `CarouselViewTests.CollectionChangePreservesSynchronousCurrentItemOverride` failed with `Assert.Equal() Failure: Expected: 1, Actual: 0` after 0.54 s. Since 11-13 it failed in 6 of 552 Windows device runs: candidate 1688573, #40361's 1687233, #40288's 1683284, darc-net11 1681785, net11 1680671 and inflight 1680652. The test file is identical on the candidate, `net11` and `main`. **Root cause (test race).** Removing the current item makes `replacement` current, and the test's `CurrentItemChanged` handler overrides it to `override`. Synchronously, the handler sets `Position = 1` and queues the deferred override scroll. In this test, item 1 is not visible yet, so the Low-priority `CompleteCollectionCurrentItemOverrideScroll` does three things: 1. It calls `ScrollIntoView`. Since the viewport width equals the item width, this already centers item 1 natively. 2. It schedules a 50 ms retry. 3. On the retry pass, it sees the item visible, clears the override and calls `ItemsView.ScrollTo(1, Center, animate: false)`. That call raises the counted `ScrollToRequested`. So the visible centering always precedes the counted request by at least 50 ms. The test asserted `scrollToRequests == 1` as soon as `WaitForCenteredPositionAsync` (100 ms poll) observed centering. It passed only when the poll landed after the retry pass. **Fix.** Wait for the request before asserting the count, exactly like the sibling `CollectionChangePreservesCurrentItemOverrideFromPositionChanged` test: ```csharp await AssertEventually(() => scrollToRequests == 1, timeout: 2000, message: "The deferred current-item override did not request its final centered scroll."); ``` Every existing assertion is unchanged, including `Assert.Equal(1, scrollToRequests)` and the Mode/Index/Center/IsAnimated checks, so a duplicate request still fails. No timeout, retry or tolerance changes. ### Issues Fixed Fixes a failing device test on the SR2 candidate (#40116). ### Validation Pending Windows device CI. The evidence will be added here. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 19, 2026
…ic (#40395) <!-- 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 a test-only follow-up to #40394, which merged into the SR2 candidate (#40116). 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. No product code changes. #40394 merged into `candidate/11.0.1xx-sr2` (fc55531) while it still contained a temporary diagnostic test, `CarouselViewTests.DiagnosticSynchronousCurrentItemOverrideRequestOrdering`. That test reports its timing measurements through `Assert.Fail`, so it fails on every Windows device run (packaged and unpackaged). This PR deletes that method only. The fix from #40394 stays: the `AssertEventually(() => scrollToRequests == 1, …)` wait in `CollectionChangePreservesSynchronousCurrentItemOverride`. After this PR, the net change from #40394 against the previous candidate head b45b3b4 is just that 4-line wait (`git diff b45b3b4 a8985d9`). ### Issues Fixed Follow-up to #40394. Unblocks Windows device tests on #40116. ### Validation - Roslyn syntax parse of `CarouselViewTests.Windows.cs` (net11.0): 0 diagnostics. A semantic Windows compile and the Windows device run are not possible on this macOS machine. - `git diff b45b3b4 HEAD`: only the 4-line `AssertEventually` addition remains. - Pending: Windows `maui-pr-devicetests` on this PR, to confirm the diagnostic is gone and `CollectionChangePreservesSynchronousCurrentItemOverride` passes in both packaged and unpackaged runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 22, 2026
…on Windows (#40394) <!-- 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 a test-only fix for a failure on the SR2 candidate #40116. 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. No product code changes. > [!WARNING] > **Draft:** the current head includes a temporary diagnostic test, `DiagnosticSynchronousCurrentItemOverrideRequestOrdering`, which always fails and reports timings. It will be removed in a follow-up commit after Windows device CI records its results. **Symptom.** Candidate device build [1688573](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1688573) (#40116), *Run DeviceTests Windows* (`Controls.DeviceTests-packaged`): `CarouselViewTests.CollectionChangePreservesSynchronousCurrentItemOverride` failed with `Assert.Equal() Failure: Expected: 1, Actual: 0` after 0.54 s. Since 11-13 it failed in 6 of 552 Windows device runs: candidate 1688573, #40361's 1687233, #40288's 1683284, darc-net11 1681785, net11 1680671 and inflight 1680652. The test file is identical on the candidate, `net11` and `main`. **Root cause (test race).** Removing the current item makes `replacement` current, and the test's `CurrentItemChanged` handler overrides it to `override`. Synchronously, the handler sets `Position = 1` and queues the deferred override scroll. In this test, item 1 is not visible yet, so the Low-priority `CompleteCollectionCurrentItemOverrideScroll` does three things: 1. It calls `ScrollIntoView`. Since the viewport width equals the item width, this already centers item 1 natively. 2. It schedules a 50 ms retry. 3. On the retry pass, it sees the item visible, clears the override and calls `ItemsView.ScrollTo(1, Center, animate: false)`. That call raises the counted `ScrollToRequested`. So the visible centering always precedes the counted request by at least 50 ms. The test asserted `scrollToRequests == 1` as soon as `WaitForCenteredPositionAsync` (100 ms poll) observed centering. It passed only when the poll landed after the retry pass. **Fix.** Wait for the request before asserting the count, exactly like the sibling `CollectionChangePreservesCurrentItemOverrideFromPositionChanged` test: ```csharp await AssertEventually(() => scrollToRequests == 1, timeout: 2000, message: "The deferred current-item override did not request its final centered scroll."); ``` Every existing assertion is unchanged, including `Assert.Equal(1, scrollToRequests)` and the Mode/Index/Center/IsAnimated checks, so a duplicate request still fails. No timeout, retry or tolerance changes. ### Issues Fixed Fixes a failing device test on the SR2 candidate (#40116). ### Validation Pending Windows device CI. The evidence will be added here. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 22, 2026
…ic (#40395) <!-- 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 a test-only follow-up to #40394, which merged into the SR2 candidate (#40116). 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. No product code changes. #40394 merged into `candidate/11.0.1xx-sr2` (fc55531) while it still contained a temporary diagnostic test, `CarouselViewTests.DiagnosticSynchronousCurrentItemOverrideRequestOrdering`. That test reports its timing measurements through `Assert.Fail`, so it fails on every Windows device run (packaged and unpackaged). This PR deletes that method only. The fix from #40394 stays: the `AssertEventually(() => scrollToRequests == 1, …)` wait in `CollectionChangePreservesSynchronousCurrentItemOverride`. After this PR, the net change from #40394 against the previous candidate head b45b3b4 is just that 4-line wait (`git diff b45b3b4 a8985d9`). ### Issues Fixed Follow-up to #40394. Unblocks Windows device tests on #40116. ### Validation - Roslyn syntax parse of `CarouselViewTests.Windows.cs` (net11.0): 0 diagnostics. A semantic Windows compile and the Windows device run are not possible on this macOS machine. - `git diff b45b3b4 HEAD`: only the 4-line `AssertEventually` addition remains. - Pending: Windows `maui-pr-devicetests` on this PR, to confirm the diagnostic is gone and `CollectionChangePreservesSynchronousCurrentItemOverride` passes in both packaged and unpackaged runs. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 23, 2026
…on Windows (#40394) <!-- 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 a test-only fix for a failure on the SR2 candidate #40116. 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. No product code changes. > [!WARNING] > **Draft:** the current head includes a temporary diagnostic test, `DiagnosticSynchronousCurrentItemOverrideRequestOrdering`, which always fails and reports timings. It will be removed in a follow-up commit after Windows device CI records its results. **Symptom.** Candidate device build [1688573](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1688573) (#40116), *Run DeviceTests Windows* (`Controls.DeviceTests-packaged`): `CarouselViewTests.CollectionChangePreservesSynchronousCurrentItemOverride` failed with `Assert.Equal() Failure: Expected: 1, Actual: 0` after 0.54 s. Since 11-13 it failed in 6 of 552 Windows device runs: candidate 1688573, #40361's 1687233, #40288's 1683284, darc-net11 1681785, net11 1680671 and inflight 1680652. The test file is identical on the candidate, `net11` and `main`. **Root cause (test race).** Removing the current item makes `replacement` current, and the test's `CurrentItemChanged` handler overrides it to `override`. Synchronously, the handler sets `Position = 1` and queues the deferred override scroll. In this test, item 1 is not visible yet, so the Low-priority `CompleteCollectionCurrentItemOverrideScroll` does three things: 1. It calls `ScrollIntoView`. Since the viewport width equals the item width, this already centers item 1 natively. 2. It schedules a 50 ms retry. 3. On the retry pass, it sees the item visible, clears the override and calls `ItemsView.ScrollTo(1, Center, animate: false)`. That call raises the counted `ScrollToRequested`. So the visible centering always precedes the counted request by at least 50 ms. The test asserted `scrollToRequests == 1` as soon as `WaitForCenteredPositionAsync` (100 ms poll) observed centering. It passed only when the poll landed after the retry pass. **Fix.** Wait for the request before asserting the count, exactly like the sibling `CollectionChangePreservesCurrentItemOverrideFromPositionChanged` test: ```csharp await AssertEventually(() => scrollToRequests == 1, timeout: 2000, message: "The deferred current-item override did not request its final centered scroll."); ``` Every existing assertion is unchanged, including `Assert.Equal(1, scrollToRequests)` and the Mode/Index/Center/IsAnimated checks, so a duplicate request still fails. No timeout, retry or tolerance changes. ### Issues Fixed Fixes a failing device test on the SR2 candidate (#40116). ### Validation Pending Windows device CI. The evidence will be added here. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
kubaflo
added a commit
that referenced
this pull request
Nov 23, 2026
…ic (#40395) <!-- 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 a test-only follow-up to #40394, which merged into the SR2 candidate (#40116). 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. No product code changes. #40394 merged into `candidate/11.0.1xx-sr2` (fc55531) while it still contained a temporary diagnostic test, `CarouselViewTests.DiagnosticSynchronousCurrentItemOverrideRequestOrdering`. That test reports its timing measurements through `Assert.Fail`, so it fails on every Windows device run (packaged and unpackaged). This PR deletes that method only. The fix from #40394 stays: the `AssertEventually(() => scrollToRequests == 1, …)` wait in `CollectionChangePreservesSynchronousCurrentItemOverride`. After this PR, the net change from #40394 against the previous candidate head b45b3b4 is just that 4-line wait (`git diff b45b3b4 a8985d9`). ### Issues Fixed Follow-up to #40394. Unblocks Windows device tests on #40116. ### Validation - Roslyn syntax parse of `CarouselViewTests.Windows.cs` (net11.0): 0 diagnostics. A semantic Windows compile and the Windows device run are not possible on this macOS machine. - `git diff b45b3b4 HEAD`: only the 4-line `AssertEventually` addition remains. - Pending: Windows `maui-pr-devicetests` on this PR, to confirm the diagnostic is gone and `CollectionChangePreservesSynchronousCurrentItemOverride` passes in both packaged and unpackaged runs. 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
…on Windows (dotnet#40394) <!-- 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 a test-only fix for a failure on the SR2 candidate dotnet#40116. 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. No product code changes. > [!WARNING] > **Draft:** the current head includes a temporary diagnostic test, `DiagnosticSynchronousCurrentItemOverrideRequestOrdering`, which always fails and reports timings. It will be removed in a follow-up commit after Windows device CI records its results. **Symptom.** Candidate device build [1688573](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1688573) (dotnet#40116), *Run DeviceTests Windows* (`Controls.DeviceTests-packaged`): `CarouselViewTests.CollectionChangePreservesSynchronousCurrentItemOverride` failed with `Assert.Equal() Failure: Expected: 1, Actual: 0` after 0.54 s. Since 11-13 it failed in 6 of 552 Windows device runs: candidate 1688573, dotnet#40361's 1687233, dotnet#40288's 1683284, darc-net11 1681785, net11 1680671 and inflight 1680652. The test file is identical on the candidate, `net11` and `main`. **Root cause (test race).** Removing the current item makes `replacement` current, and the test's `CurrentItemChanged` handler overrides it to `override`. Synchronously, the handler sets `Position = 1` and queues the deferred override scroll. In this test, item 1 is not visible yet, so the Low-priority `CompleteCollectionCurrentItemOverrideScroll` does three things: 1. It calls `ScrollIntoView`. Since the viewport width equals the item width, this already centers item 1 natively. 2. It schedules a 50 ms retry. 3. On the retry pass, it sees the item visible, clears the override and calls `ItemsView.ScrollTo(1, Center, animate: false)`. That call raises the counted `ScrollToRequested`. So the visible centering always precedes the counted request by at least 50 ms. The test asserted `scrollToRequests == 1` as soon as `WaitForCenteredPositionAsync` (100 ms poll) observed centering. It passed only when the poll landed after the retry pass. **Fix.** Wait for the request before asserting the count, exactly like the sibling `CollectionChangePreservesCurrentItemOverrideFromPositionChanged` test: ```csharp await AssertEventually(() => scrollToRequests == 1, timeout: 2000, message: "The deferred current-item override did not request its final centered scroll."); ``` Every existing assertion is unchanged, including `Assert.Equal(1, scrollToRequests)` and the Mode/Index/Center/IsAnimated checks, so a duplicate request still fails. No timeout, retry or tolerance changes. ### Issues Fixed Fixes a failing device test on the SR2 candidate (dotnet#40116). ### Validation Pending Windows device CI. The evidence will be added here. 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
…ic (dotnet#40395) <!-- 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 a test-only follow-up to dotnet#40394, which merged into the SR2 candidate (dotnet#40116). 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. No product code changes. dotnet#40394 merged into `candidate/11.0.1xx-sr2` (fc55531) while it still contained a temporary diagnostic test, `CarouselViewTests.DiagnosticSynchronousCurrentItemOverrideRequestOrdering`. That test reports its timing measurements through `Assert.Fail`, so it fails on every Windows device run (packaged and unpackaged). This PR deletes that method only. The fix from dotnet#40394 stays: the `AssertEventually(() => scrollToRequests == 1, …)` wait in `CollectionChangePreservesSynchronousCurrentItemOverride`. After this PR, the net change from dotnet#40394 against the previous candidate head b45b3b4 is just that 4-line wait (`git diff b45b3b4 a8985d9`). ### Issues Fixed Follow-up to dotnet#40394. Unblocks Windows device tests on dotnet#40116. ### Validation - Roslyn syntax parse of `CarouselViewTests.Windows.cs` (net11.0): 0 diagnostics. A semantic Windows compile and the Windows device run are not possible on this macOS machine. - `git diff b45b3b4 HEAD`: only the 4-line `AssertEventually` addition remains. - Pending: Windows `maui-pr-devicetests` on this PR, to confirm the diagnostic is gone and `CollectionChangePreservesSynchronousCurrentItemOverride` passes in both packaged and unpackaged runs. 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 reviewFor .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. No product code changes.
Warning
Draft: the current head includes a temporary diagnostic test,
DiagnosticSynchronousCurrentItemOverrideRequestOrdering, which always fails and reports timings. It will be removed in a follow-up commit after Windows device CI records its results.Symptom. Candidate device build 1688573 (#40116), Run DeviceTests Windows (
Controls.DeviceTests-packaged):CarouselViewTests.CollectionChangePreservesSynchronousCurrentItemOverridefailed withAssert.Equal() Failure: Expected: 1, Actual: 0after 0.54 s. Since 11-13 it failed in 6 of 552 Windows device runs: candidate 1688573, #40361's 1687233, #40288's 1683284, darc-net11 1681785, net11 1680671 and inflight 1680652. The test file is identical on the candidate,net11andmain.Root cause (test race). Removing the current item makes
replacementcurrent, and the test'sCurrentItemChangedhandler overrides it tooverride. Synchronously, the handler setsPosition = 1and queues the deferred override scroll. In this test, item 1 is not visible yet, so the Low-priorityCompleteCollectionCurrentItemOverrideScrolldoes three things:ScrollIntoView. Since the viewport width equals the item width, this already centers item 1 natively.ItemsView.ScrollTo(1, Center, animate: false). That call raises the countedScrollToRequested.So the visible centering always precedes the counted request by at least 50 ms. The test asserted
scrollToRequests == 1as soon asWaitForCenteredPositionAsync(100 ms poll) observed centering. It passed only when the poll landed after the retry pass.Fix. Wait for the request before asserting the count, exactly like the sibling
CollectionChangePreservesCurrentItemOverrideFromPositionChangedtest:Every existing assertion is unchanged, including
Assert.Equal(1, scrollToRequests)and the Mode/Index/Center/IsAnimated checks, so a duplicate request still fails. No timeout, retry or tolerance changes.Issues Fixed
Fixes a failing device test on the SR2 candidate (#40116).
Validation
Pending Windows device CI. The evidence will be added here.