Skip to content

[net11.0][Android] Register reentrant Flyout fixture in native-Shell Window tests - #39571

Closed
kubaflo wants to merge 1 commit into
net11.0from
kubaflo-net11-reentrant-window-root
Closed

kubaflo wants to merge 1 commit into
net11.0from
kubaflo-net11-reentrant-window-root

Conversation

@kubaflo

@kubaflo kubaflo commented Oct 22, 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!

Description of Change

Superseded by #39536. This exact test-only fix is now included in the consolidated PR at 63ef2602a7b7350595f10236097056991a55550e, with identical file contents and preserved attribution. This standalone PR is being closed without merging. The per-fix evidence below remains historical evidence for this PR's original head, not new native validation of the combined head; combined-head checks and pending CI are documented in #39536.

Register the existing ReentrantFlyoutPage / ReentrantFlyoutViewHandler fixture pair in Android WindowHandlerTests.SetupBuilder.

The native-Shell subclass replaces WindowTests.SetupBuilder rather than invoking it, and omitted this registration. Its inherited RootReplacementDuringFlyoutConstructionPublishesLatestRoot test therefore receives an ordinary FlyoutViewHandler: OnCreatingPlatformView never runs, window.Page never becomes the final NavigationPage, and waiting for the final page's native attachment times out. The base WindowTests class already registers the pair and passes unchanged.

Scope: one line in ShellHandlerSubclasses.Android.cs, based on current net11.0 commit 7b0ea7800db3f3faccbaecb665d32b7c61eaf932. Native ShellHandler, ShellItemHandler, and ShellSectionHandler registrations are preserved. No product code, regression trigger, assertions, timeouts, sleeps, skips, GC fixtures/helpers, dependencies, or pipeline configuration are changed. This is a fixture-wiring correction, not a navigation-product fix or a claim that all CI failures are fixed.

Original failure: device build 1644557, investigating #39536. The exact derived-class case fails on Android Mono and CoreCLR, and also fails in exact-base build 1643729. #39536 remains untouched.

Native causal validation

Full repository Controls device-test APKs; pinned .NET SDK 11.0.100-rtm.26514.118 (product 11.0.100), Android workload 37.2.15, private headless API 33 ARM64 emulator. Mono and CoreCLR were built separately, with their distinct native runtime payloads verified.

Every row below was run in three fresh application processes per runtime, selecting the exact failing Microsoft.Maui.DeviceTests.WindowHandlerTests class using the existing runner's temporary class-filter injection. Each actual xUnit XML contains exactly 33 distinct cases, no skips/errors, and no unrelated class.

APK input Android Mono, each of 3 runs Android CoreCLR, each of 3 runs
Unchanged target fixture 32 passed / 1 failed: exact original timeout 32 passed / 1 failed: exact original timeout
One-line registration fix 33 passed / 0 failed 33 passed / 0 failed
Reinstall unchanged baseline APK 32 passed / 1 failed: same timeout 32 passed / 1 failed: same timeout
Reinstall fixed APK 33 passed / 0 failed 33 passed / 0 failed

Reversion/restoration means switching the installed native APK input, not rewriting repository history. Immutable target source is used for baseline builds. The 24 processes have independently checked distinct Android PIDs; 792 case executions reconcile with the XML assembly counts. The other 32 tests pass in every arm, including superseded requests, discarded prepared roots, fragment-execution deferral, toolbar redirection, disconnect reentrancy, and native root attachment.

The passing test retains its original assertions: construction really reenters, window.Page is the final root, the superseded Flyout handler is disconnected, the final toolbar exists, the published platform root matches, and the final page is actually attached beneath that native root.

Separately, unchanged base WindowTests passed 33/33 in four Mono processes. These are controls, not evidence that the failing derived subclass passed before the fix.

Commands and results (E contains preserved, uncommitted validation scripts, APKs, logs and XML):

E="$HOME/.copilot/session-state/73b5ca16-6343-4a5e-bb44-eaa12e175e88/files"
DOTNET="$HOME/.copilot/session-state/c33a22b9-b10e-4231-9b6e-2cf2ef8bc415/files/dotnet-net11/dotnet"

"$DOTNET" build Microsoft.Maui.BuildTasks.slnf -c Release -m:2 \
  -p:BuildInParallel=false \
  -p:IncludeIosTargetFrameworks=false -p:IncludeMacCatalystTargetFrameworks=false \
  -p:IncludeMacOSTargetFrameworks=false -p:IncludeWindowsTargetFrameworks=false \
  -p:IncludeTizenTargetFrameworks=false -p:TreatWarningsAsErrors=false \
  -bl:"$E/buildtasks.binlog" --nologo -v:q
# Passed: 0 errors; 3 existing Gradle warnings.

bash "$E/build-root.sh" exact-derived-baseline mono
bash "$E/build-root.sh" fixed mono
bash "$E/build-root.sh" baseline-compatible coreclr true
bash "$E/build-root.sh" fixed coreclr
# All four builds passed. Each builds Controls.DeviceTests.csproj, Release,
# net11.0-android, android-arm64, with full project references and class injection.
# Mono: UseMonoRuntime=true, RunAOTCompilation=false.
# CoreCLR: UseMonoRuntime=false, PublishReadyToRun=false.
# Both: AndroidPackageFormat=apk, EmbedAssembliesIntoApk=true.
# CoreCLR baseline substitutes the byte-identical immutable target fixture file.

for runtime in mono coreclr; do
  for arm in baseline fixed reverted restored; do
    input=baseline; expected=Fail
    if [ "$arm" = fixed ] || [ "$arm" = restored ]; then
      input=fixed; expected=Pass
    fi
    python3 "$E/run-root.py" "derived-$arm-$runtime" 3 "$expected" \
      Microsoft.Maui.DeviceTests.WindowHandlerTests \
      "$E/exact-derived-$input-$runtime.apk"
  done
done
# Passed all expected-result controls; parses actual XML, not just exit codes.
# Each fresh invocation uses:
# "$DOTNET" xharness android test --app "$E/exact-derived-$input-$runtime.apk" \
#   --package-name com.microsoft.maui.controls.devicetests \
#   --device-id emulator-5712 --output-directory "$E/derived-$arm-$runtime-$repeat" \
#   --timeout 00:10:00 --arg TestFilter=Category=Window \
#   --arg "results-file-name=derived-$arm-$runtime-$repeat.xml"

python3 "$E/summarize-root.py"
# Passed: 24 distinct app PIDs, 792 case executions, expected target outcomes.

"$DOTNET" format Microsoft.Maui.sln --no-restore --exclude Templates/src \
  --exclude-diagnostics CA1822 \
  --include src/Controls/tests/DeviceTests/Elements/Shell/ShellHandlerSubclasses.Android.cs \
  --verbosity quiet
# Passed.
git diff --check
# Passed.

An initial emulator exit 134 occurred before any test installation/execution and is not counted as a target failure. The successful causal matrix ran only after verifying the private emulator's boot state, API and architecture under an exclusive local-runtime lease. The owned emulator was stopped and its private AVD removed afterward; no shared ADB server, other device, global SDK/workload or configuration changes.

Open PR exact-file inventory (87 PRs) and recent main/net11/inflight file history found no duplicate fixture fix. pr-finalize verifies the focused diff and title/body consistency. Local evidence is Android ARM64 only; no local MacCatalyst, XCTest, desktop UI automation, cross-platform certification or full-suite-green claim.

Issues Fixed

No separate issue. Fixes the pre-existing Android native-Shell WindowHandlerTests.RootReplacementDuringFlyoutConstructionPublishesLatestRoot fixture failure identified while investigating #39536.

Match the base WindowTests registration so the inherited construction-reentry test actually invokes its replacement callback in WindowHandlerTests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 73b5ca16-6343-4a5e-bb44-eaa12e175e88
Copilot AI balanced review requested due to automatic review settings October 22, 2026 18:30
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 22, 2026 18:30 — with GitHub Actions Inactive
@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 -- 39571

Or

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

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 22, 2026 18:30 — 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.

@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

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.

🔵 Needs a closer look

No code defects were identified, but current required CI results and reported Android validation were not independently verified.

No open issues 🎉

What changed in this PR

Corrects Android native-Shell device-test setup so the inherited Window reentrancy test uses its intended fixture handler. The title and description match the one-line change.

Changes:

  • Registers ReentrantFlyoutPage with ReentrantFlyoutViewHandler in WindowHandlerTests.SetupBuilder.
  • Preserves existing native-Shell registrations, test assertions, and product code.
File Description
src/​Controls/​tests/​DeviceTests/​Elements/​Shell/​ShellHandlerSubclasses.Android.cs Adds the missing reentrant Flyout fixture registration.

Review effort: Balanced

@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 22, 2026 18:36 — with GitHub Actions Inactive
@kubaflo
kubaflo temporarily deployed to copilot-pat-pool October 22, 2026 18:36 — with GitHub Actions Inactive
@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Oct 22, 2026
@kubaflo kubaflo closed this Oct 22, 2026

This branch was previously deployed

1 inactive deployment
copilot-pat-pool — 0f554a80 Deployed Oct 22, 2026 by kubaflo via conclusion #2470
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s/agent-review-in-progress AI review is currently running for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants