Repository navigation
Description
What
On Android (Mono, interpreter, Debug), a TabBar tab visited for the first time after a C# hot-reload edit never loads its page. Given_TabBar_HotReload is excluded from the mobile hot-reload lanes (#3238) until this is fixed.
The other findings below are tracked separately:
- Edits piling up in one process: fixed by per-class isolation in ci: run hot-reload runtime tests on Android and iOS #3238; the Mono side is Hot reload on Android: Mono BadImageFormatException after ~100 deltas in one process #3243.
- Failed reverts leaving edited source: HR runtime tests: a failed revert leaves the source file edited #3244.
Measured locally on an API 36 emulator against a DevServer, with the #3235 fix applied.
| Class | All classes in one process | Class alone, fresh process |
|---|---|---|
Reactive.WinUI.Tests.Given_HotReload |
14/14 | 14/14 |
Navigation.UI.Tests.Given_HotReload |
7/7 | 7/7 |
Navigation.UI.Tests.Given_Navigation_HotReload |
16/22 | 22/22 |
Navigation.UI.Tests.Given_TabBar_HotReload |
2/23 | 13/23, then 7/23 on a rerun |
Findings
1. Real Android bug: a tab visited for the first time after a C# hot reload never loads. In Given_TabBar_HotReload:
- Passes: visit TabTwo, hot-reload, switch back.
- Fails: hot-reload, then go to a tab not visited before. The tab's
FrameViewregion exists but no page appears within 30s.
Tab 'TabTwo' did not populate a HotReloadTabContentPage within 30s. ContentGrid children: [FrameView[Region.Name='TabOne'], FrameView[Region.Name='TabTwo']]
These failed in both isolated runs:
When_SwitchTabAfterUpdate_Then_SelectedTabReflectsUpdateWhen_UnvisitedTabVisitedAfterHR_Then_ShowsUpdatedContentWhen_CycleThroughAllTabsAfterHR_Then_AllReflectUpdateWhen_GatedTabUnlockedByHR_Then_TabContentLoadsWhen_XamlHRAddsTabThenCSharpHRAddsRoute_Then_NavigationWorksWhen_TabBarAddedViaXamlHR_ThenCSharpHRInjectsRoute_Then_NewTabNavigableWhen_RegionAttachedRemovedFromTabBarViaXamlHR_Then_ContentNotBlankedWhen_TabBarItemRemovedViaXamlHR_Then_RemainingTabStillWorksWhen_TabBarItemOrderSwappedViaXamlHR_Then_BothTabsNavigableWhen_TabBarItemAddedRemovedReaddedViaXamlHR_Then_NavigationStillWorks
They all pass on Skia desktop (CoreCLR). Plain frame navigation to a new page after a hot reload works on Android (Navigation…Given_HotReload 7/7). So this looks specific to materializing a TabBar region for the first time after a delta.
2. (Handled elsewhere) Failures from edits piling up in one process. On desktop each class runs in its own secondary app. On mobile the lanes run every class in one process, so about 100 edits pile up. Running everything in one process is what produced:
- the
BadImageFormatException: type 0x00 not handled in do_mono_metadata_parse_typecascade (19 TabBar tests) - all 6
Given_Navigation_HotReloadfailures
Neither happens with the class run alone.
3. (Handled elsewhere, #3244) A failed revert leaves the source file edited. After the TabBar runs, Pages/HotReloadTabBarXamlPage.xaml still had a duplicated TabBarItem, so later XAML tests start from a modified file. That likely accounts for the rerun's extra XAML failures.
Work
- Find why a never-visited tab region doesn't load after a C# delta on Android, and fix it in Navigation (or upstream).
- Add
Given_TabBar_HotReloadto the mobile lanes'AndroidTestFilters/IosTestFilters. iOS hasn't been measured for this class yet.
Reproducing locally
See the "Mobile lanes" note in AGENTS.md. An Android app built on Windows needs the RuntimeTestsSourceProjectAttribute path rewritten with /, or every relative-path edit times out.
Activity
[-]Hot-reload runtime tests failing on Android (Mono): Given_TabBar_HotReload, Given_Navigation_HotReload[/-][+]Hot reload on Android: unvisited TabBar tab doesn't load after a C# delta; mobile HR tests need per-class isolation[/+][-]Hot reload on Android: unvisited TabBar tab doesn't load after a C# delta; mobile HR tests need per-class isolation[/-][+]Hot reload on Android: TabBar tab visited for the first time after a C# edit never loads[/+]ci: isolate mobile hot-reload tests per class
ci: select mobile hot-reload classes with the desktop '_HotReload' fi…
ci: run hot-reload runtime tests on Android and iOS