Repository navigation
[ci-fix] De-flake DisplayAlert navigation with push completion (refs #38016) - #38381
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This was referenced Sep 10, 2026
kubaflo
approved these changes
Sep 10, 2026
kubaflo
marked this pull request as ready for review
September 10, 2026 17:23
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 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
GoBackButtonAutomationIduntil afterawait 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
This was referenced Sep 10, 2026
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>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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!
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
DisplayAlertAsyncShouldNotCrashWhenPageUnloadedatIssue33287.cs:28, where the test waits forMainPageLabelimmediately after tapping the second page's back button. The test exposedGoBackButtonas soon as the second page was constructed, so Appium could find and tap it whileNavigation.PushAsyncwas 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
GoBackButtonautomation ID only afterNavigation.PushAsynccompletes.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
Validation
not run because the MacCatalyst UI test requires a macOS device rigEvidence
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. EligibleCHANGES_REQUESTEDreviews 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.