Skip to content

Conversation

@MrJul
Copy link
Member

@MrJul MrJul commented Nov 18, 2025

What does the pull request do?

This PR rewrites all tests in the LeakTests project to avoid dotMemory Unit.
dotMemory Unit doesn't work correctly on modern .NET runtimes (see #20004).
Plus, the tests randomly fail on CI, which is quite annoying.

All tests are now using WeakReference instead.

While the changes are relatively straightforward, the Transition_On_StyledProperty_Is_Freed is the only test that checked for an instance of a type not directly accessible (TransitionInstance) anywhere. A few internal members have been added to get a hold of that instance.

ControlTests are only executed in release mode (somehow some instances are temporarily kept rooted in debug mode). This isn't worse than before, where tests needed to be started through dotMemory Unit anyway and most still failed in debug mode.

Fixed issues

@MrJul MrJul added enhancement area-infrastructure Issues related to CI/tooling infrastructur labels Nov 18, 2025
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060130-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul force-pushed the feature/rewrite-leak-tests branch from 8276247 to 7cfd946 Compare November 19, 2025 14:44
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060154-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Issues related to CI/tooling infrastructur enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite leak tests without dotMemory

2 participants