Skip to content

HR runtime tests: a failed revert leaves the source file edited #3244

Open

Description

@kazo0

What

When a hot-reload runtime test fails partway through, its source edit can stay applied. HotReloadHelper.UpdateSourceFile returns an IAsyncDisposable that reverts the edit, and the revert itself goes through the DevServer. If the DevServer or app is in a bad state, the revert silently doesn't land.

Observed after running Given_TabBar_HotReload on an Android emulator: src/Uno.Extensions.Navigation.UI.Tests/Pages/HotReloadTabBarXamlPage.xaml still had a duplicated TabBarItem.

Impact

  • Later tests start from modified source, so one failure causes others (Expected value to be 2, but found 3 in a later TabBar run).
  • Locally, the working tree is left dirty, and the change is easy to commit by accident.

CI checks out clean sources each run, so this only cascades within a run.

Work

  • Make reverts verifiable: after disposing, check that the file content matches the original and fail loudly if not. Possibly restore the file directly from disk as a fallback (engine HotReloadHelper or a repo-side wrapper).
  • Consider restoring all HotReload* source files at class cleanup.

Activity

  1. added
    area/build
    kind/maintainer-experience
    on Oct 15, 2026
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/buildkind/maintainer-experience

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions