-
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
Conversation
| }); | ||
| } | ||
|
|
||
| private void RunInprocTestbed(TestbedParameters parameters, int timeout = 300000) |
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.
…; use explicit test package parameter in tests
| <!-- Windows Vista --> | ||
| <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />--> | ||
|
|
||
| <!-- Windows 7 --> | ||
| <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />--> | ||
|
|
||
| <!-- Windows 8 --> | ||
| <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />--> | ||
|
|
||
| <!-- Windows 8.1 --> | ||
| <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />--> |
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.
nit: do we need to keep this part of the template?
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</TreatWarningAsError> | ||
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</TreatWarningAsError> | ||
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">stdcpp17</LanguageStandard> | ||
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdcpp17</LanguageStandard> |
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.
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">true</TreatWarningAsError> | |
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</TreatWarningAsError> | |
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">stdcpp17</LanguageStandard> | |
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdcpp17</LanguageStandard> | |
| <TreatWarningAsError>true</TreatWarningAsError> | |
| <LanguageStandard>stdcpp17</LanguageStandard> |
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | ||
| <LinkIncremental>true</LinkIncremental> | ||
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | ||
| <EmbedManifest>false</EmbedManifest> | ||
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> | ||
| <LinkIncremental>true</LinkIncremental> | ||
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | ||
| <EmbedManifest>false</EmbedManifest> | ||
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | ||
| <LinkIncremental>true</LinkIncremental> | ||
| <OutDir>$(SolutionDir)x86\$(Configuration)\$(ProjectName)\</OutDir> | ||
| <EmbedManifest>false</EmbedManifest> | ||
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | ||
| <LinkIncremental>false</LinkIncremental> | ||
| <OutDir>$(SolutionDir)x86\$(Configuration)\$(ProjectName)\</OutDir> | ||
| <EmbedManifest>false</EmbedManifest> | ||
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | ||
| <LinkIncremental>false</LinkIncremental> | ||
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | ||
| <EmbedManifest>false</EmbedManifest> | ||
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> | ||
| <LinkIncremental>false</LinkIncremental> | ||
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | ||
| <EmbedManifest>false</EmbedManifest> | ||
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | ||
| </PropertyGroup> |
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.
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
| <LinkIncremental>true</LinkIncremental> | |
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | |
| <EmbedManifest>false</EmbedManifest> | |
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'"> | |
| <LinkIncremental>true</LinkIncremental> | |
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | |
| <EmbedManifest>false</EmbedManifest> | |
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> | |
| <LinkIncremental>true</LinkIncremental> | |
| <OutDir>$(SolutionDir)x86\$(Configuration)\$(ProjectName)\</OutDir> | |
| <EmbedManifest>false</EmbedManifest> | |
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> | |
| <LinkIncremental>false</LinkIncremental> | |
| <OutDir>$(SolutionDir)x86\$(Configuration)\$(ProjectName)\</OutDir> | |
| <EmbedManifest>false</EmbedManifest> | |
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
| <LinkIncremental>false</LinkIncremental> | |
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | |
| <EmbedManifest>false</EmbedManifest> | |
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'"> | |
| <LinkIncremental>false</LinkIncremental> | |
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | |
| <EmbedManifest>false</EmbedManifest> | |
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | |
| </PropertyGroup> | |
| <PropertyGroup> | |
| <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\</OutDir> | |
| <OutDir Condition="'$(Platform)'=='Win32'">$(SolutionDir)x86\$(Configuration)\$(ProjectName)\</OutDir> | |
| <EmbedManifest>false</EmbedManifest> | |
| <CopyLocalProjectReference>true</CopyLocalProjectReference> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(Configuration)'=='Debug'"> | |
| <LinkIncremental>true</LinkIncremental> | |
| </PropertyGroup> | |
| <PropertyGroup Condition="'$(Configuration)'=='Release'"> | |
| <LinkIncremental>false</LinkIncremental> | |
| </PropertyGroup> |
| <Manifest> | ||
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ComInprocTestbed.manifest</AdditionalManifestFiles> | ||
| </Manifest> | ||
| <Manifest> | ||
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">ComInprocTestbed.manifest</AdditionalManifestFiles> | ||
| </Manifest> |
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.
| <Manifest> | |
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ComInprocTestbed.manifest</AdditionalManifestFiles> | |
| </Manifest> | |
| <Manifest> | |
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">ComInprocTestbed.manifest</AdditionalManifestFiles> | |
| </Manifest> | |
| <Manifest> | |
| <AdditionalManifestFiles>ComInprocTestbed.manifest</AdditionalManifestFiles> | |
| </Manifest> |
| <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'"> | ||
| <ClCompile> | ||
| <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</TreatWarningAsError> | ||
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdcpp17</LanguageStandard> | ||
| </ClCompile> | ||
| <Manifest> | ||
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ComInprocTestbed.manifest</AdditionalManifestFiles> | ||
| </Manifest> | ||
| </ItemDefinitionGroup> |
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.
| <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'"> | |
| <ClCompile> | |
| <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</TreatWarningAsError> | |
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">stdcpp17</LanguageStandard> | |
| </ClCompile> | |
| <Manifest> | |
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ComInprocTestbed.manifest</AdditionalManifestFiles> | |
| </Manifest> | |
| </ItemDefinitionGroup> | |
| <ItemDefinitionGroup Condition="'$(Platform)'=='Win32'"> | |
| <ClCompile> | |
| <PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
| </ClCompile> | |
| </ItemDefinitionGroup> |
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</TreatWarningAsError> | ||
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</TreatWarningAsError> | ||
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</TreatWarningAsError> | ||
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">stdcpp17</LanguageStandard> | ||
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdcpp17</LanguageStandard> | ||
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">stdcpp17</LanguageStandard> |
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.
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">true</TreatWarningAsError> | |
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</TreatWarningAsError> | |
| <TreatWarningAsError Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</TreatWarningAsError> | |
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">stdcpp17</LanguageStandard> | |
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">stdcpp17</LanguageStandard> | |
| <LanguageStandard Condition="'$(Configuration)|$(Platform)'=='Release|x64'">stdcpp17</LanguageStandard> | |
| <TreatWarningAsError>true</TreatWarningAsError> | |
| <LanguageStandard>stdcpp17</LanguageStandard> |
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> | ||
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> | ||
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader> | ||
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader> | ||
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> | ||
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> |
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.
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> | |
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> | |
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader> | |
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader> | |
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> | |
| <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> | |
| <PrecompiledHeader>Create</PrecompiledHeader> |
| <Manifest> | ||
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">ComInprocTestbed.manifest</AdditionalManifestFiles> | ||
| </Manifest> | ||
| <Manifest> | ||
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ComInprocTestbed.manifest</AdditionalManifestFiles> | ||
| </Manifest> | ||
| <Manifest> | ||
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ComInprocTestbed.manifest</AdditionalManifestFiles> | ||
| </Manifest> |
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.
| <Manifest> | |
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">ComInprocTestbed.manifest</AdditionalManifestFiles> | |
| </Manifest> | |
| <Manifest> | |
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ComInprocTestbed.manifest</AdditionalManifestFiles> | |
| </Manifest> | |
| <Manifest> | |
| <AdditionalManifestFiles Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ComInprocTestbed.manifest</AdditionalManifestFiles> | |
| </Manifest> | |
| <Manifest> | |
| <AdditionalManifestFiles>ComInprocTestbed.manifest</AdditionalManifestFiles> | |
| </Manifest> |
| string assemblyLocation = Assembly.GetExecutingAssembly().Location; | ||
| this.InprocTestbedPath = Path.Join(Path.GetDirectoryName(assemblyLocation), "..\\ComInprocTestbed\\ComInprocTestbed.exe"); |
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.
Isn't there something like a TestContext.TestDirectory?
| @@ -0,0 +1,602 @@ | |||
| // Copyright (c) Microsoft Corporation. | |||
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.
(I'll admit that I didn't read this file very closely...)
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