Skip to content

Conversation

@JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Dec 16, 2025

Issue

One of the inproc tests is failing because the module is not unloaded (nor are any of the statics destroyed) after the attempt to unload it through CoFreeUnusedLibrariesEx. This suggests that objects are still active and the unload is doing the correct thing.

While this could be a leak, the initial thinking is that this test fails due to the background threads racing to finish up their work as the main thread continues on after the completion is signaled. The name-based tests that expect the module to unload also need to free the activation factories that C++/WinRT caches before calling into the test method, which appears to be giving them enough time to complete successfully.

Change

Add a sleep option to the tests and use it for the failing one. A more invasive solution would be to use the shutdown monitoring the forcibly close out and wait for the background threads, but test only exports are a pain to manage.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner December 16, 2025 22:05
@JohnMcPMS JohnMcPMS merged commit 3cb22d9 into microsoft:master Dec 17, 2025
9 checks passed
@JohnMcPMS JohnMcPMS deleted the fix-inproc-test branch December 17, 2025 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants