Repository navigation
Description
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: 4build/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:
- ~15 % of the Android runtime test suite has no CI coverage on these stages β a regression in any of those tests cannot be caught.
- 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
fix(ci): Align Android Skia shard 0 test group count
fix(ci): Align Android Skia shard 0 test group count
fix(ci): Align Android Skia shard 0 test group count