-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Test host for in-proc COM module validation #5910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JohnMcPMS
wants to merge
13
commits into
microsoft:master
Choose a base branch
from
JohnMcPMS:inproc-testbed
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,867
−134
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
dkbennett
approved these changes
Dec 8, 2025
| }); | ||
| } | ||
|
|
||
| private void RunInprocTestbed(TestbedParameters parameters, int timeout = 300000) |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to have default timeout constant defined, though it looks like this is the only place it is referenced. This 5m seems like a good number since we've seen other tests hit 2m randomly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #5869 and #5870 in the current code and will be backported to 1.12
Change
Adds a test host that leverages the in-proc COM module (as built locally) to validate various lifetime management scenarios. It has numerous options for controlling the scenarios, as well as an extensible model for adding different tests in the future.
It was able to hit the faults described in the linked issues, and the fixes are included:
ServerShutdownSynchronizationto integrate with the signal monitoring directly, rather than registering as an object. This also means that there is no need to unregister, preventing the construction of aTerminationSignalHandler.DLL_PROCESS_DETACHhandler. If the caller is using the module properly via COM, theDllCanUnloadNowcalls should take care of things. If the process is exiting without that call, leaking objects will be fine (the caller didn't uninitialize COM, so it is doubtful they care about a clean exit).Additionally, these changes were made to support additional scenarios:
DllCanUnloadNowfrom checking the object state, always returning that it cannot unload now. This can be used to prevent the module from being unloaded (and any active static objects alive) even if no external objects are active.Validation
The test host is run with various parameters as part of the E2E tests.
The linked issues are represented within the set of tests, as are several other scenarios.
Microsoft Reviewers: Open in CodeFlow