Skip to content

[Flaky] Fixed the Issue34975 flaky issue - #37805

Merged
kubaflo merged 1 commit into
dotnet:mainfrom
Ahamed-Ali:fixflakyfailures
Aug 27, 2026
Merged

kubaflo merged 1 commit into
dotnet:mainfrom
Ahamed-Ali:fixflakyfailures

Conversation

@Ahamed-Ali

@Ahamed-Ali Ahamed-Ali commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Issue

The test read StatusLabel immediately after tapping Check Memory. The in-app GarbageCollectionHelper.WaitForGC operation can take up to five seconds, during which the label displays "Checking...". This race condition caused the test to fail before the memory check completed, even when no memory leak existed.

Build link : https://dev.azure.com/dnceng-public/public/_build/results?buildId=1565488&view=ms.vss-test-web.build-test-results-tab&runId=43115338&resultId=100235&paneView=debug

image

Description of Change

Updated the UI test to wait until StatusLabel contains "Still alive:", indicating that the garbage-collection check has completed, before asserting the final result. The wait uses the helper’s default 15-second timeout, which is sufficient for the five-second operation. The test then verifies that the final text is "Still alive: 0".

Issues Fixed

Fixes #36418

@github-actions

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

Or

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

@dotnet-policy-service dotnet-policy-service Bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Aug 25, 2026
@Ahamed-Ali Ahamed-Ali added the community ✨ Community Contribution label Aug 25, 2026
@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.

@sheiksyedm

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests

@azure-pipelines

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

@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.

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

This PR addresses a flaky MAUI UI test (Issue34975) by waiting for the in-app garbage-collection/memory-check flow to complete before asserting the final β€œStill alive: 0” result, avoiding a race where the label can still read β€œChecking...”.

Changes:

  • Updated the Issue34975 UI test to wait for StatusLabel to contain β€œStill alive:” before asserting the final expected value.
  • Added an explicit assertion to fail early if the memory-check completion text never appears.

Comment on lines +23 to +25
// GarbageCollectionHelper.WaitForGC runs for up to 5 seconds inside the app.
var memoryCheckCompleted = App.WaitForTextToBePresentInElement("StatusLabel", "Still alive:");
Assert.That(memoryCheckCompleted, Is.True, "Memory check did not complete within the expected time.");
@kubaflo
kubaflo merged commit 90e5e93 into dotnet:main Aug 27, 2026
154 of 164 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 27, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool β€” 8ed057f1 Deployed Aug 25, 2026 by Ahamed-Ali via conclusion #1519
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-shell area-testing Unit tests, device tests community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration testing-flakiness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci-scan] Recurring: ShellTitleViewWithXNameShouldNotLeakMemory fails on macOS in maui-pr-uitests

4 participants