Apply the servicing follow-up from #12225 (upstream b3f3c98) on top of the original #12220 release isolation fix. Preserve release file layout and targets, cleanup ownership/deadlines, independent failures and Framework aggregate messages.
Retained tests execute against actual prior production: 12 of 136 lifecycle cases and 4 of 13 packed consumers fail for the intended missing corrections. Corrected code passes 732 focused unit executions, all 13 packaged consumers, and both 10-case source-generation opt-out plans.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Backport only the later cleanup review corrections from #12225. The original isolation fix #12220 is already in
rel/4.5. This is an independent, squashable cleanup slice split from #12287, not a closing reference to that bundle.Preserves release
TestMethodInfo.Execution.cslayout and the non-null activation guard; separates cancellation from cleanup ownership, retains original deadlines and context-owned CTS lifetime, aggregates independent cleanup failures without losing timeout/inconclusive semantics, and recursively formats nested aggregate messages on .NET Framework. Exactly six source/test files; no fixture, Retry, IPC, F# feature, orMtpServerProcessslice. Public/shipped APIs and TFMs are unchanged; all six C# BOMs are preserved.Revision identity
826ef0f11a51e59861ceeb6e994917587add82d5601527fac8ea3e03811f0a433093b7a10099e3ce(parent6be7eec3169d5324fdcf75c425b5e0e16a46fadf)0a9a932a7af6780b749d4d040ea8f38336ef339ba39964ce2cf09c4abcbaa7bb8f4e5818638a9de332b68854ed6d552ebe4d71e1558c20a7643dca5cPlain cherry-pick of the source commit; existing coauthor retained. The standalone tree equals the independently prepared six-file tree exactly.
Fresh standalone validation
All results below were executed against this standalone head, not borrowed from the original bundle's proof. Private checkout SDK
12.0.100-alpha.1.26480.103, outputs and NuGet caches; Windows/VS MSBuild.TestMethodInfoTests: net462, net48TestMethodInfoTests: net8.0, net9.0, net8.0-windows10.0.18362.0TestResultTests: net48, net8.0, net9.0, net8.0-windows10.0.18362.0CleanupCancellationIsolationTests, default source generationMSTEST_ACCEPTANCE_SKIP_SOURCEGEN=1MSTEST_ACCEPTANCE_SKIP_SOURCEGEN=trueThe opt-outs reduce the discovery plan; they are not skipped tests. Fresh outer TRX names, unique execution IDs, timestamps, counters and exit codes were checked against the exact plans. Packaged consumers checked loaded payload hashes, exact lifecycle traces, owned-resource removal, result names/outcomes, timeout details and both Framework failure identities (
FailingCleanupTests.LocalCleanupandGlobalCleanupFixtures.GlobalCleanup). Independently retained 24/18/18 exact traces and 13/10/10 inner reports; no owned resources remained.[DoNotParallelize]remains on the shared generated-asset class; assembly-level method parallelization and the sequential internal TestContainer engine are unchanged.The newly packed
MSTest.TestAdapter.4.5.3-devandMSTest.TestFramework.4.5.3-devboth identify the standalone commit in their nuspec repository metadata. Built, packed and loaded payload SHA-256 values matched:MSTestAdapter.PlatformServices.dllFD7CCFB7ADA0B156C4BA9CB1C3B32C0F028488275CF662678F9DCEA8C62A8A04MSTest.TestFramework.dll80C8D8BC0153AA59D198082A5E6A14DD97494258828B8340FC17B6D5C3EA9B22Executed validation commands (only checkout/proof roots abbreviated)
$repodenotes this checkout and$proofits retained session evidence directory. Subsequent invocations used$repo\.dotnetwith checkout-private.packages,artifacts\nuget-http-cache,artifacts\nuget-scratchandartifacts\dotnet-home;MSBUILDUSESERVER=0,DOTNET_CLI_UI_LANGUAGE=en-US.All three commands passed. Direct test-host commands were expanded over the target sets shown above:
All nine unit invocations passed with the exact class counts above. After pack, the following discovery/execution pair ran once with the opt-out unset (
$mode=default), once set to1, and once set totrue; all passed:The net11.0 outer host requests the pinned .NET 12 runtime in its runtimeconfig; the generated consumers actually run net8.0 and net462. Fresh generated-asset builds produced seven binlogs, retained in per-plan directories before the next process could reuse their filenames.
Limitations: real AppX activation, hosted UI execution and current-head CI were not validated. No new counterfactual campaign was run on this head. TRX, source/payload provenance, exact traces and unique binlogs are retained as session evidence; generated consumer assets and per-run caches were removed, without clearing shared caches. This PR does not merge or modify #12287.