Disable failing Mark-of-the-Web test and fix parallel test failures#54945
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Windows Mark-of-the-Web (MOTW) unit test to be resilient on newer/locked-down Windows images where the urlmon InternetSecurityManager COM class may exist but no longer maps Zone.Identifier to an Internet-zone classification.
Changes:
- Replace the “COM class exists” gate with a functional probe that independently calls
MapUrlToZoneon the test file. - Add minimal COM interop for
IInternetSecurityManagerto support the probe and conditionally assert the detector result based on actual zone mapping behavior.
DangerousFileDetectorTests.ItShouldDetectFileWithMarkOfTheWeb relies on the legacy IE/urlmon InternetSecurityManager to detect a file's Mark-of-the-Web zone. On the new windows.amd64.vs2026.pre.scout image (IE removed), MapUrlToZone no longer reliably honors the Zone.Identifier stream, and the behavior even diverges between an independent probe and the product's IsDangerous, so the positive assertion cannot be reliably gated. Disable the test on this image pending a robust approach, tracked by dotnet#54951. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
56ca1fd to
8489e73
Compare
…odLevel parallelism ItCanAddDependents, ItCanFindVisualStudioDependents, and ItWillNotRemoveTheProviderIfOtherDependentsExist all create and mutate the same hardcoded registry key (.NET_SDK_TEST_PROVIDER_KEY). xUnit ran methods within a class serially, but the migration to MSTest MethodLevel parallelism (dotnet#54766) runs them concurrently, causing intermittent 'expected 1, actual 2 dependents' and missing-subkey failures. Add class-level [DoNotParallelize] to restore serial execution, matching the existing pattern used elsewhere in the repo. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The 'full' and 'partial' DataRows of ILLink_TrimMode_new_options run concurrently under MSTest MethodLevel parallelism. Both passed a bare '-bl' to the publish command, which writes msbuild.binlog to the process current directory. Since PublishCommand did not set a working directory, that resolved to the shared Helix work-item directory, so the two DataRows raced on the same msbuild.binlog and the publish failed with MSB4104 (file used by another process). Set the command's working directory to the per-DataRow project directory (which is unique because the test asset identifier includes targetFramework + trimMode), so the binary log is written there instead of the shared current directory. This matches the pattern already used by DotnetBuildCommand. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run dotnet-sdk-public-ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s), but failed to run 1 pipeline(s). |
That description does not match what the pull request currently does.
The summary doesn't match it either, as the test gets disabled even if the Windows instance includes IE. |
|
@KalleOlaviNiemitalo Thanks, I've updated the title and description to match the current PR changes |
|
/ba-g failures are MTPHelpSnapshotTests failures which were fixed in #54950 |
Three independent test-stabilization fixes found while triaging #54871's CI failures:
DangerousFileDetectorTests.ItShouldDetectFileWithMarkOfTheWebcan't pass on IE-less Windows images — urlmonMapUrlToZoneignores the MOTW stream, and the productIsDangerousand a capability probe diverge — so it's[Ignore]d against DangerousFileDetectorTests.ItShouldDetectFileWithMarkOfTheWeb fails on IE-less vs2026.pre.scout image #54951.DependencyProviderTests: its methods share a hardcoded registry key and race under MSTestMethodLevelparallelism (Set MSTest.Sdk-wide defaults: UseMSTestSdk, method-level parallelization, Recommended analyzers #54766). Added class-level[DoNotParallelize].ILLink_TrimMode_new_optionsbinlog collision: the parallelfull/partialDataRows both wrotemsbuild.binlogto the shared work-item directory (MSB4104). Set a per-DataRow working directory.