Skip to content

Android Skia CI shards miss 15% of runtime tests (shard 0 declares GROUP_COUNT 4, shards 1-4 declare 5)Β #24002

Closed

Description

@MartinZikmund

Current behavior πŸ›

The Tests - Android Skia and Tests - Android+CoreCLR Skia CI stages shard the runtime tests across 5 matrix jobs (Runtime Tests 0 … Runtime Tests 4), but shard 0 declares a different shard count than the other four:

  • build/ci/tests/.azure-devops-tests-android-skia.yml:31 β†’ UITEST_RUNTIME_TEST_GROUP_COUNT: 4
  • build/ci/tests/.azure-devops-tests-android-coreclr-skia.yml:32 β†’ UITEST_RUNTIME_TEST_GROUP_COUNT: 4

while Runtime Tests 1–4 in both files declare UITEST_RUNTIME_TEST_GROUP_COUNT: 5.

Test selection is a stable hash modulo the declared count (UnitTestsControl.cs:1415):

where groupCount == -1 || (groupCount != -1 && (GetTypeTestGroup(test) % (ulong)groupCount) == (ulong)activeGroup)

with GetTypeTestGroup = BitConverter.ToUInt64(SHA1(DeclaringType.FullName + "." + method.Name), 0) (UnitTestsControl.cs:1425-1432).

So shard 0 selects hash % 4 == 0 while shards 1–4 select hash % 5 == 1..4. The union of the five shards is therefore not the full suite:

  • Tests never selected by any shard: hash % 5 == 0 && hash % 4 != 0 β†’ 15 %
  • Tests selected by two shards (executed twice): hash % 4 == 0 && hash % 5 != 0 β†’ 20 %

Measured by replicating the exact partition function over the 4 543 [TestMethod]s currently in Uno.UI.RuntimeTests:

current expected
Tests executed by no shard 669 (14.73 %) 0
Tests executed by two shards 921 (20.27 %) 0
Total test executions per run 4 795 4 543
Shard 0 workload 1 152 tests 900 tests

Examples of test methods that no Android Skia shard currently runs:

Microsoft.UI.Tests.Controls.DatePickerTests.DatePickerIntegrationTests.CanChooseDate
Microsoft.UI.Xaml.Tests.Controls.Grid_Tests.GridIntegrationTests.CanLayoutWithColumnSpan
Microsoft.UI.Xaml.Tests.Enterprise.CalendarDatePickerTests.CalendarDatePickerIntegrationTests.CanOpenCloseFlyoutBySettingIsCalendarOpen

The in-app consistency self-check (UnitTestsControl.cs:1374-1389, which asserts the groups are disjoint and complete) cannot catch this: it iterates 0 .. _ciTestsGroupCountCache using the job's own count, so shard 0 validates a self-consistent 4-way split and never observes the other jobs' 5-way split.

This has two consequences:

  1. ~15 % of the Android runtime test suite has no CI coverage on these stages β€” a regression in any of those tests cannot be caught.
  2. Shard 0 carries 28 % more tests than it should (1 152 vs 900), which makes it the slowest shard and the one most likely to hit the 45-minute job timeout.

The Tests - Android+NativeAOT Skia stage is not affected β€” .azure-devops-tests-android-nativeaot-skia.yml correctly declares 5 for all five shards. The WebAssembly Skia (4 shards / count 4), WebAssembly Native (3 / 3) and Android Native (5 / 5) stages are also consistent.

Expected behavior 🎯

All five matrix jobs declare UITEST_RUNTIME_TEST_GROUP_COUNT: 5, so the five shards form an exact partition of the suite: every test runs exactly once, and the shards are evenly sized.

How to reproduce it (as minimally and precisely as possible) πŸ”¬

Inspect the matrix in build/ci/tests/.azure-devops-tests-android-skia.yml: Runtime Tests 0 declares UITEST_RUNTIME_TEST_GROUP_COUNT: 4, Runtime Tests 1–4 declare 5.

To reproduce the coverage gap numerically, replicate the partition function over the runtime-test method names:

group(name) = BitConverter.ToUInt64(SHA1(UTF8(name)), 0)
shard 0 selects group(name) % 4 == 0
shard k selects group(name) % 5 == k   (k = 1..4)

and count names matched by zero shards (669 / 4 543) and by two shards (921 / 4 543).

Workaround πŸ› οΈ

None at the CI level β€” the affected tests simply do not run on these stages.

Renderer 🎨

Skia

Affected platforms πŸ“±πŸ’»πŸ–₯️

Android (CI test infrastructure only β€” no impact on shipped product code)

Uno.Sdk version (and other relevant versions) πŸ“¦

N/A β€” CI pipeline configuration in this repository. Present on both master and feature/breakingchanges.

IDE version πŸ§‘β€πŸ’»

N/A

Anything else we need to know? πŸ’¬

Introduced when the Android Skia matrix grew from 4 to 5 shards: Runtime Tests 1–4 were updated to 5 but Runtime Tests 0 was left at 4. The value has read 4 for shard 0 since at least commit 909a6218638.

Found while analysing Azure DevOps CI failure data for pipeline Uno.UI - CI (definition 5).

Note that fixing this is expected to make the Tests - Android Skia stage fail more often at first, because 669 tests that have never run in CI will start running. That is the true baseline, not a regression introduced by the fix.

Activity

  1. added
    kind/bug
    on Aug 7, 2026
  2. added 3 commits that reference this issue on Aug 22, 2026
    6526712
    6a3fecb
    4e03128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cikind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions