Skip to content

[ci-fix] De-flake DisplayAlert navigation with push completion (refs #38016) - #38381

Merged
kubaflo merged 1 commit into
mainfrom
ci-fix/issue-38016-6f726b5f9d907d81
Sep 10, 2026
Merged

kubaflo merged 1 commit into
mainfrom
ci-fix/issue-38016-6f726b5f9d907d81

Conversation

@github-actions

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!

Workflow artifact: ci-fix
Artifact kind: deflake
Refs: #38016
Target branch: main
Attempt: 1/10

Attempt 1 of 10

Expose the second page's back button to Appium only after the navigation push has completed.

Previous attempts (prior commits on this PR)

None.

This attempt differs by: this is the first attempt.

Root cause

Build 1587350 intermittently failed DisplayAlertAsyncShouldNotCrashWhenPageUnloaded at Issue33287.cs:28, where the test waits for MainPageLabel immediately after tapping the second page's back button. The test exposed GoBackButton as soon as the second page was constructed, so Appium could find and tap it while Navigation.PushAsync was still completing. On MacCatalyst, that tap can be ignored during the transition, leaving the test on the second page until the element wait times out.

Flake class: test-quality

Why this was flaky

The test synchronized on element existence rather than completion of the push transition. The same target failed twice in build 1587350 but passed on every platform in build 1589336, demonstrating transition-timing sensitivity rather than a persistent product failure.

De-flake

The host page now assigns the GoBackButton automation ID only after Navigation.PushAsync completes. App.WaitForElement("GoBackButton") therefore becomes a deterministic navigation-completion barrier before the test taps back. No assertion was weakened, no timeout was increased, and no retry attribute was added.

Fix

Keep the existing back-button command and test assertions, but delay automation exposure until the page is fully pushed.

What is unverified / where I need help

  • The MacCatalyst UI test could not be run because this Linux runner has no MacCatalyst device rig.
  • Please confirm the MacCatalyst Page UI-test leg consistently completes the return navigation and still exercises the delayed alert on the unloaded page.

Validation

  • Command: not run because the MacCatalyst UI test requires a macOS device rig
  • Result: not run

Evidence


Filed by ci-status-fix. This is the single PR for #38016: the workflow watches its own CI and pushes up to 10 attempts on this same PR (it never opens a second PR). It advances only when the fix's own build settles red and that red is caused by the fix. Comments, reviews, and commits do not transfer ownership; the loop remains autonomous until this PR is closed. Eligible CHANGES_REQUESTED reviews are handled through Track C. After 10 attempts it stops and defers to humans. In round 1 a maintainer still needs to comment /azp run maui-pr (plus the gated uitests/devicetests legs when relevant) to exercise each new commit.

Generated by CI Failure Fixer (main) · gpt56 · 376.2 AIC · ⌖ 33.6 AIC · ⊞ 23.4K · ◷

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

@kubaflo
kubaflo marked this pull request as ready for review September 10, 2026 17:23
Copilot AI lite review requested due to automatic review settings September 10, 2026 17:23
@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.

@kubaflo
kubaflo merged commit 699f16e into main Sep 10, 2026
21 of 31 checks passed
@kubaflo
kubaflo deleted the ci-fix/issue-38016-6f726b5f9d907d81 branch September 10, 2026 17:25
@github-actions github-actions Bot added this to the .NET 10 SR11 milestone Sep 10, 2026

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.

🟢 Approval recommended

The change is narrowly scoped to test host UI wiring, matches the PR description, and uses an existing handler mapping path that supports runtime AutomationId updates.

Pull request overview

This PR addresses flakiness in the Issue33287 UI test scenario by preventing Appium from interacting with the “Go Back” button until the navigation push transition has completed, improving determinism on timing-sensitive platforms (notably MacCatalyst).

Changes:

  • Delay assigning the GoBackButton AutomationId until after await Navigation.PushAsync(...) completes.
  • Refactor the second page’s back button into a field and expose a helper to assign the automation id post-push.
File summaries
File Description
src/Controls/tests/TestCases.HostApp/Issues/Issue33287.cs Defers GoBackButton automation exposure until navigation push completes to reduce Appium race/timing flakiness.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

kubaflo added a commit that referenced this pull request Sep 15, 2026
…ests failure (#38564)

This PR addresses UI test failures in the main branch caused by this PR
#38381. It also includes updates to
improve rendering and test stability across platforms.
<img width="733" height="257" alt="image"
src="https://github.com/user-attachments/assets/51c50316-b906-42fd-b4ee-9117c18ce47b"
/>


**Test reliability and feedback improvements:**

* Added a `Label` (`statusLabel`) to `Issue33287MainPage` to display
status updates about the alert request, making it easier to observe the
test's progress and results.
* Updated navigation and alert logic so that when navigating to
`Issue33287SecondPage`, a callback updates the status label as the alert
request is created and returned, improving visibility into the test
flow.

**Code simplification and modernization:**

* Refactored `Issue33287SecondPage` to remove the internal button field
and use a constructor parameter for status updates, and replaced the
delayed alert logic with a property change handler that triggers the
alert when the page is detached.
* Removed unnecessary `using System.Threading.Tasks;` and added `using
System.ComponentModel;` for property change handling.

**Test assertion enhancements:**

* Updated the test in `Issue33287.cs` to assert that the status label
reflects the alert request and that the app remains responsive,
providing more robust and meaningful test coverage.

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants