Repository navigation
test(a11y): Wait for Android accessibility records instead of idle - #25838
ramezgerges merged 1 commit into
Conversation
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242355 found UI Test snapshots differences: Details
|
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
🤖 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]>
4e1e1f0 to
8517508
Compare
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 242364 found UI Test snapshots differences: Details
|
|
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. |
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_RecordedGiven_MobileAccessibilityEvents_Android.When_AutomationId_Changes_Then_NodeInvalidated_Is_RecordedGiven_MobileAccessibilityLifecycle_US7_Android.When_Action_Called_From_Background_Thread_Then_Click_Is_Queued_For_UI_ThreadWhen it started: the 12 master
Uno.UI - CIbuilds up toc9edce1f4a(Oct 27 23:35 UTC) have no failures in these tests. Every master build fromf42052205aonward does (1 to 6 per build, a different subset each time). #25487 is in between.Cause:
AndroidSkiaAccessibilityrecords most events (node and root invalidations, background-thread actions) from a message it posts to the main looper through a plainHandler, so a synchronous message that the view system's sync barriers hold back. #25487 made the dispatcher's handler asynchronous, so dispatcher work, and thereforeWaitForIdle, 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 afterWaitForIdle. 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:WaitForEventsAsyncpolls 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.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_Offsetthen failed on Android on both runs and on every retry (theScrollViewerended 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.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code