Skip to content

[release/11.0.1xx-preview7] Stabilize empty CollectionView footer screenshot - #37074

Closed
kubaflo wants to merge 2 commits into
release/11.0.1xx-preview7from
kubaflo/stabilize-preview7-collectionview-footer
Closed

kubaflo wants to merge 2 commits into
release/11.0.1xx-preview7from
kubaflo/stabilize-preview7-collectionview-footer

Conversation

@kubaflo

@kubaflo kubaflo commented Aug 4, 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!

Summary

  • Give Issue28604.FooterShouldDisplayAtBottomOfEmptyView up to two seconds to reach its final MacCatalyst layout before comparing the screenshot.
  • Allow the established 0.5% rendering tolerance used by similar visual tests.
  • Reuse the existing adaptive VerifyScreenshot polling rather than adding a sleep.

Evidence

Preview 7 branch build 1538409 / test run 42368316 captured the footer transiently directly below the header instead of at the bottom of the empty CollectionView. The comparison missed by 1.00%.

The same test passed in branch builds 1538078, 1537359, and 1535908, and in PR #37070 build 1538419. That progression identifies a visual timing race rather than a persistent rendering regression.

Validation

  • Microsoft.Maui.BuildTasks.slnf builds successfully.
  • The exact MacCatalyst HostApp and test assembly build successfully and discover the targeted test.
  • Prior head 9cc174525e was proven by exact UI build 1538596: the MacCatalyst CollectionView job succeeded and Issue28604.FooterShouldDisplayAtBottomOfEmptyView passed in 2.46 seconds.
  • Current head 2ada17e35a incorporates review feedback to use a two-second retry and 0.5% tolerance; fresh exact-head CI is required.

Issues Fixed

N/A

Allow the empty CollectionView footer visual assertion to retry during the brief MacCatalyst layout race observed in Preview 7 CI.

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

Copilot-Session: 9be49656-7117-4235-9d96-404779ab6b16
Copilot AI review requested due to automatic review settings August 4, 2026 04:07
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 4, 2026 04:07 — with GitHub Actions Inactive
@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@github-actions

github-actions Bot commented Aug 4, 2026

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 -- 37074

Or

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

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 4, 2026 04:07 — with GitHub Actions Inactive
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Improves stability of the Issue28604.FooterShouldDisplayAtBottomOfEmptyView UI screenshot test by allowing VerifyScreenshot to retry for up to 3 seconds, reducing flakiness from transient layout timing.

Changes:

  • Update the test to call VerifyScreenshot(retryTimeout: TimeSpan.FromSeconds(3)) instead of the default VerifyScreenshot() behavior.

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 4, 2026 04:12 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 4, 2026 04:13 — with GitHub Actions Inactive
@github-actions github-actions Bot added area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/macos macOS / Mac Catalyst labels Aug 4, 2026
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool August 4, 2026 04:13 — with GitHub Actions Inactive
@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/azp run maui-pr

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Exact-head proof is complete for 9cc174525e: UI build 1538596 used synthetic merge 58ace3bcf3 with this head as a parent. The authoritative MacCatalyst CollectionView job succeeded, run 42371754 had no failed individual result, and Issue28604.FooterShouldDisplayAtBottomOfEmptyView passed in 2.46 seconds. @PureWeen this is proven for its intended fix and is ready to merge.

@Ahamed-Ali

Copy link
Copy Markdown
Contributor

The changes in this PR look good. However, instead of using a 3-second retry timeout, we could reduce it to 2 seconds and also specify a screenshot tolerance of 0.5%, similar to other screenshot tests:

VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2));

As a reference, this approach is already used in other similar test cases, for example:
maui/src/Controls/tests/TestCases.Shared.Tests/Tests/Issues/Issue29693.cs.

Please let me know if we can update this in this PR. @kubaflo

@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@Ahamed-Ali sure let's do it

Use the established two-second retry window with a 0.5 percent screenshot tolerance for the empty-footer timing test.

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

Copilot-Session: 9be49656-7117-4235-9d96-404779ab6b16
Copilot AI review requested due to automatic review settings August 4, 2026 11:33
@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Head 2ada17e35a incorporates the review feedback: the adaptive screenshot check now retries for two seconds and uses the established 0.5% tolerance. Fresh exact-head proof is required before merge.

@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion, @Ahamed-Ali! This has already been applied in the latest commit — the test now uses VerifyScreenshot(tolerance: 0.5, retryTimeout: TimeSpan.FromSeconds(2)), matching the pattern in Issue29693.cs.

@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Post-review exact-head proof is complete for 2ada17e35a: main build 1539069 succeeded, and UI build 1539070 used synthetic merge 39b0ec061f with this head as its second parent. Issue28604.FooterShouldDisplayAtBottomOfEmptyView passed on the exact head across Android, WinUI/CV1, iOS/vlatest, and MacCatalyst (including the later canceled MacCatalyst CollectionView leg, where this target completed successfully before the unrelated cancellation). The remaining red checks are outside this one-test screenshot change. @PureWeen the reviewed two-second/0.5% version is proven and ready to merge.

@kubaflo

kubaflo commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #37081, which is now the single rebased test-only stabilization PR for Preview 7.

@kubaflo kubaflo closed this Aug 4, 2026
PureWeen pushed a commit that referenced this pull request Aug 4, 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!

### Description of Change

Bundles independently valid Preview 7 test and test-infrastructure
stabilizations into one merge path. Changes are cherry-picked or
extracted from their source PRs without modifying MAUI runtime or
product behavior.

The aggregate currently covers:

- exact DragEvents label polling and shared Appium text-wait behavior;
- waiting for the iOS Entry keyboard before its snapshot;
- adaptive ListView and CollectionView screenshot stabilization;
- RefreshView gesture retry and SwipeView callback-result waiting;
- stable initial SafeArea layout measurement;
- deterministic iOS Picker-to-Entry keyboard transition handling;
- a bounded Android screenshot tolerance for stable post-rotation
antialiasing variance;
- independent iOS and MacCatalyst Graphics image-scaling device
coverage;
- a bounded UIKit cleanup wait for the CarouselView leak assertion;
- Android-only scoping for the Android modal-animation leak regression
test;
- an exact detached-page transition with a synchronous alert-request
return signal; and
- resilient Windows test-machine resolution setup, with focused Pester
coverage for each fallback and failure path.

Eligible UI tests, device tests, unit tests, test infrastructure, and
screenshot baselines can all be included here when they are
independently valid without a corresponding product-code change.

### Source PRs

The standalone source PRs below are closed in favor of this aggregate.
For #37057, only the independently valid test subset is included; its
product-code rewrite remains excluded.

| PR | Included test-side fix |
|---|---|
| #37044 | Windows screen-resolution test infrastructure and Pester
coverage |
| #37045 | DragEvents exact-text waits and Appium helper |
| #37053 | iOS Entry keyboard readiness |
| #37055 | ListView screenshot retry window |
| #37057 | Graphics image-scaling device tests that pass without the
runtime rewrite |
| #37058 | RefreshView pull-to-refresh retry |
| #37059 | SwipeView result-label wait |
| #37066 | SafeArea initial-layout retry |
| #37069 | Picker keyboard transition stabilization |
| #37074 | Empty CollectionView footer screenshot retry/tolerance |
| #37086 | iOS/MacCatalyst CarouselView leak-test cleanup wait |
| #37088 | Detached-page alert request synchronization |
| #37091 | Android modal-animation leak-test platform scope |
| #37092 | Android Issue22306 post-rotation screenshot tolerance |

### Scope exclusions

Mixed runtime/test fixes are included only when their test-side changes
pass independently against the unmodified product code. The current
device tests in #37052, the four nonpositive-size cases in #37057, and
the device test plus screenshots in #37062 remain excluded because they
expose or describe behavior that requires those PRs' functional fixes.
#37070 has no test-side changes. Closed ineffective or unsafe fixes are
also excluded.

### Validation

- All 25 directly reusable source commits were cherry-picked in their
original order.
- The #37057 device-test subset was extracted into one additional
test-only commit after proving it against the unmodified product
implementation.
- Every directly cherry-picked aggregate file matches the corresponding
included source PR head.
- The aggregate diff contains no MAUI runtime or product files.
- Targeted Release builds pass for `UITest.Appium`,
`Controls.TestCases.iOS.Tests`, `Controls.TestCases.Mac.Tests`, and
`Controls.TestCases.Android.Tests`.
- The focused screen-resolution Pester suite passes 14/14.
- Exact local xUnit XML reports 46/46 Graphics device tests passing on
both iOS 26 and MacCatalyst, including all 13 extracted cases.
- The Graphics deadlock regression now asserts the bounded five-second
completion result before awaiting the scaling task.
- The CarouselView category passes 6 consecutive MacCatalyst runs at 4/4
each and passes 4/4 on iOS 26 with the final 100 ms cleanup wait.
- The Android modal-animation leak test passes in both discovered
Android variants, while the iOS device-test assembly excludes that
Android-specific regression test.
- The Issue22306 Android failure's three retries were byte-for-byte
identical at a 1.85% visual difference, below the new Android-only 2%
tolerance.
- The unloaded-page alert probe now signals immediately after
`DisplayAlertAsync` returns, avoiding a teardown-order dependency on the
detached page task.
- Rebased the aggregate onto release head `dee83edd121`; the resulting
diff remains limited to tests and test infrastructure.
- The Pester workflow now triggers when
`eng/scripts/Set-ScreenResolution.ps1` changes.
- A standalone `/azp run` was posted for aggregate head `83da465424b`;
exact merge `bad9e4e9a57` builds `1539860`, `1539861`, and `1539862` are
required before merge.

### Issues Fixed

Contributes to stabilizing the .NET 11 Preview 7 test branch.

---------

Co-authored-by: Vally Fixture <vally-fixture@example.invalid>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: kubaflo <34349119+kubaflo@users.noreply.github.com>
Copilot-Session: 9be49656-7117-4235-9d96-404779ab6b16
Copilot-Session: d00747b7-96f3-4e7a-8dfb-e3a48db04b2d
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-collectionview CollectionView, CarouselView, IndicatorView platform/macos macOS / Mac Catalyst

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants