Skip to content

test(a11y): Wait for Android accessibility records instead of idle - #25838

Merged
ramezgerges merged 1 commit into
unoplatform:masterfrom
ramezgerges:dev/rara/android-a11y-async-handler
Oct 30, 2026
Merged

ramezgerges merged 1 commit into
unoplatform:masterfrom
ramezgerges:dev/rara/android-a11y-async-handler

Conversation

@ramezgerges

@ramezgerges ramezgerges commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

GitHub Issue: related to #25487 (no dedicated issue; this fixes a CI regression on master)

PR Type:

🧪 Tests

What changed? 🚀

Since #25487, the Android Skia runtime-test lanes fail on master and on every PR with a varying subset of the Android accessibility tests, for example:

  • Given_MobileAccessibilityEvents_Android.When_Child_Is_Added_Then_StructureChanged_Is_Recorded
  • Given_MobileAccessibilityEvents_Android.When_AutomationId_Changes_Then_NodeInvalidated_Is_Recorded
  • Given_MobileAccessibilityLifecycle_US7_Android.When_Action_Called_From_Background_Thread_Then_Click_Is_Queued_For_UI_Thread

When it started: the 12 master Uno.UI - CI builds up to c9edce1f4a (Oct 27 23:35 UTC) have no failures in these tests. Every master build from f42052205a onward does (1 to 6 per build, a different subset each time). #25487 is in between.

Cause: AndroidSkiaAccessibility records most events (node and root invalidations, background-thread actions) from a message it posts to the main looper through a plain Handler, so a synchronous message that the view system's sync barriers hold back. #25487 made the dispatcher's handler asynchronous, so dispatcher work, and therefore WaitForIdle, runs past those barriers. Before, both were synchronous messages on the same looper and ran in the order they were posted, so these tests could read the event log right after WaitForIdle. Now they read it before the record exists whenever a traversal barrier is up.

Fix (tests only): the tests wait for the record instead of reading the log once after WaitForIdle:

  • WaitForEventsAsync polls until an event of the expected kind is recorded, then collects for a short while longer so the tests that bound a count (coalescing, burst add/remove) still see the whole burst.
  • The background-thread action test (Android and iOS classes) waits for the click, then still asserts it fired exactly once.

Why not change the adapter: the first version of this PR posted the adapter's messages asynchronously too. That fixed these tests on two CI runs, but Given_TextBox.When_Keyboard_Selection_Backwards_ScrollViewer_Offset then failed on Android on both runs and on every retry (the ScrollViewer ended at offset 251 instead of 0), and never on master. Delivering accessibility work earlier changed TextBox scrolling, so that change is dropped. The delay itself is harmless for apps: accessibility updates land once the pending traversal completes.

Validation

  • SamplesApp (net11.0-desktop, compiles these tests) builds with analyzers on.
  • Runtime validation is this PR's Android Skia lanes. I couldn't run the classes on a local emulator.

PR Checklist ✅

🤖 Generated with Claude Code

@github-actions github-actions Bot added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform area/skia ✏️ Categorizes an issue or PR as relevant to Skia labels Oct 29, 2026
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 242355 found UI Test snapshots differences: skia-linux-screenshots: 2458, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • AppBarButtonWithIconTest.png-dark
    • AppBarToggleButtonTest.png
    • Application_DispatcherShutdownMode.png
    • AppXamlDefinedResources.png-dark
    • Attributed_text_Simple.png-dark
    • AuthenticationBroker_Cancel.png-dark
    • AutoBorderStretchwithleftmargin.png
    • AutomationProperties_Name.png-dark
    • AutomationProperties_Name.png
    • AutoSizedTopLeft.png-dark
    • AutoSizedTopLeft.png
    • AutoSuggestBox_Description.png-dark
    • AutoSuggestBox_Description.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • BasicEnability.png-dark
    • BasicEnability.png
    • Battery.png-dark
    • Battery.png
  • skia-windows-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AppBarButtonTest.png
    • AppBar_KeyBoard.png-dark
    • ApplicationViewSizing.png
    • AppWindowClosing.png-dark
    • AppWindowFeatures.png
    • AppWindowTitleBar Properties.png-dark
    • Arrange_Performance01.png
    • AuthenticationBroker_Cancel.png
    • AuthenticationBroker_Demo.png-dark
    • AutomationProperties_Landmark.png
    • AutomationProperties_Name.png-dark
    • AutoSuggestBox_BitmapIcon.png-dark
    • AutoSuggestBox_BitmapIcon.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • Basics_Automated.png-dark
    • Basics_Automated.png
    • BeginTime_MultipleAnimations.png-dark
    • BeginTime_MultipleAnimations.png

@ramezgerges

Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines

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

@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

The Android adapter records most events from a synchronous main-looper
message, which the view system's sync barriers can hold back. Since
unoplatform#25487 the dispatcher posts asynchronous messages that skip those
barriers, so WaitForIdle can return before the record exists, and these
tests failed intermittently on every Android lane. They now poll for the
expected record, and the background-thread action test waits for its
click.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@ramezgerges
ramezgerges force-pushed the dev/rara/android-a11y-async-handler branch from 4e1e1f0 to 8517508 Compare October 29, 2026 23:04
@ramezgerges ramezgerges changed the title fix(a11y): Post Android accessibility work as asynchronous messages test(a11y): Wait for Android accessibility records instead of idle Oct 29, 2026
@unodevops

Copy link
Copy Markdown
Contributor

🤖 Your WebAssembly Sample App stage site is ready! Visit it here:

@nventive-devops

Copy link
Copy Markdown
Contributor

The build 242364 found UI Test snapshots differences: skia-linux-screenshots: 2458, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png-dark
    • AppBarButtonTest.png
    • AppBar_KeyBoard.png
    • ApplicationViewSpanningRectsPage.png-dark
    • AppWindowClosing.png-dark
    • AppWindowPositionAndSize.png
    • AppXamlDefinedResources.png
    • Arrange_Performance01.png
    • Attributed_text_Supserscript.png-dark
    • Attributed_text_Supserscript.png
    • AutoBorderStretchwithleftmargin.png
    • AutoBorderStretchwithrightmargin.png-dark
    • AutomationProperties_Name.png-dark
    • AutomationProperties_Name.png
    • AutoSizedPathCentered.png-dark
    • AutoSizedPathCentered.png
    • AutoSuggestBox_Icons.png-dark
    • AutoSuggestBox_Icons.png
    • BadgeNotificationTests.png-dark
    • BadgeNotificationTests.png
  • skia-windows-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • Accessibility_ScreenReader.png-dark
    • AppBarButtonWithIconTest.png-dark
    • ApplicationViewMode.png-dark
    • ApplicationViewSizing.png
    • AppWindowClosing.png
    • AppWindowPresenters.png
    • ArcSegment.png-dark
    • Attributed_text_Supserscript.png-dark
    • AutoBorderStretchwithbottommargin.png-dark
    • AutoBorderStretchwithbottommargin.png
    • AutomationProperties_Landmark.png
    • AutomationProperties_Name.png-dark
    • AutoSuggestBoxChosenSuggestion.png-dark
    • AutoSuggestBoxChosenSuggestion.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • Basics Pivot Test.png-dark
    • Basics Pivot Test.png
    • Battery.png-dark
    • Battery.png

@mergify

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@ramezgerges
ramezgerges merged commit 900f51c into unoplatform:master Oct 30, 2026
48 checks passed
@ramezgerges
ramezgerges deleted the dev/rara/android-a11y-async-handler branch October 30, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants