Migrate JitOptimizationSensitive and GCStressIncompatible to SkipOnCoreClr attributes - #126108
#126108Migrate JitOptimizationSensitive and GCStressIncompatible to SkipOnCoreClr attributes#126108jkoritzinsky merged 30 commits intomaindotnet/runtime:mainfrom copilot/update-requirements-for-requiresprocessisolationdotnet/runtime:copilot/update-requirements-for-requiresprocessisolationCopy head branch name to clipboard
Conversation
…odes.HeapVerify) Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/b9ff7f11-db85-474b-bed1-1e4bd364f234
…ource files
Replace MSBuild property JitOptimizationSensitive with
[SkipOnCoreClr("This test is sensitive to JIT optimizations.", RuntimeTestModes.AnyJitOptimizationStress)]
attribute directly on [Fact]/[Theory] methods across 48 test source files.
Corresponding .csproj files have the <JitOptimizationSensitive> property removed.
RequiresProcessIsolation is also removed from project files where
JitOptimizationSensitive was the sole reason for it.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e migration Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/291e5882-a072-4964-8394-d20db497e472
…IL source files Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/e0266c53-b95c-4538-80c9-b7d881f45840
… ilproj, fsproj Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com> Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/66a86949-b520-4439-8d71-659f2b4391fc
…projects - Remove GCStressIncompatible from 7 OutputType=Library projects where the property is a no-op. - Remove redundant conditional GCStressIncompatible from 10 X86 HWIntrinsics projects (both arm64+osx and arm conditions already covered by CLRTestTargetUnsupported). - Remove redundant arm-only GCStressIncompatible from 2 Arm HWIntrinsics projects (arm condition already covered by CLRTestTargetUnsupported). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add runtime HeapVerify check to ServerModel test using CoreClrConfigurationDetection.IsHeapVerify (the last project using it). - Remove HeapVerify skip logic from Batch and Bash execution script targets. - Remove auto-setting of HeapVerifyIncompatible for disasm-check tests in CLRTest.Jit.targets. - Remove all documentation references to HeapVerifyIncompatible. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Tagging subscribers to this area: @agocke, @dotnet/gc |
|
Before we make more changes to the test tree, it would be nice to make the test tree buildable again. https://github.com/dotnet/runtime/runs/68503855882 I assume this is from #125460, I've seen similar failures when I worked on the Loader tree. It would be nice to re-validate we're still running the same number of tests after #125460, the validation at #125460 (comment) must have missed this. |
|
I must have fat fingered the build command and missed the pri1 tests somehow. I'll fix that up before coming back to this. |
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot some of the projects you've edited still mention that they have RequiresProcessIsolation due to GCStressIncompatible. Please audit the projects you've edited to make sure that the reasons for a project being marked RPI are accurate. |
… comments Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/c882c5b1-c293-4d09-8e31-17947a0bdd1e Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Done in 48bc184. Audited all 78 project files where |
There was a problem hiding this comment.
Holistic Review
Motivation: Justified, unchanged. <GCStressIncompatible>, <JitOptimizationSensitive>, and <HeapVerifyIncompatible> only take effect when <RequiresProcessIsolation>true</RequiresProcessIsolation> forces an expensive per-test process. Moving eligible skips to XUnit [SkipOnCoreClr(...)]/[ConditionalFact] lets the merged in-process runner skip them without spawning a process, which is a real CI cost win.
Approach: Sound and idiomatic, unchanged. Managed entry points use [SkipOnCoreClr(msg, RuntimeTestModes.AnyGCStress|AnyJitOptimizationStress)] and IL entry points use equivalent .custom ... SkipOnCoreClrAttribute records with the correct Microsoft.DotNet.XUnitExtensions extern and public key token, mirroring the established src/tests pattern. Architecture-conditional HeapVerifyIncompatible is preserved via [ConditionalFact] gated on Utilities.IsArm/IsX86/... and CoreClrConfigurationDetection.IsHeapVerify. <RequiresProcessIsolation> is retained where genuinely required.
Summary: This is an incremental re-review. The 23 PR commits are byte-for-byte identical to the previously reviewed head (range-diff shows all 23 patches equal); the head SHA differs only because the PR was rebased onto a newer base. The sole semantic delta in the cumulative patch is in src/tests/Common/helixpublishwitharcade.proj: the doubled browser-wasm collection timeout (_TimeoutPerTestCollectionInMinutes = 246) was re-expressed during the rebase to match the reworked surrounding TargetsMobile condition, and now also applies to TargetsWasiOnCoreCLR. This is a benign, consistency-improving adaptation to upstream changes, not a behavioral regression, and it does not alter the motivation, approach, or risk of the PR. No new actionable findings. Overall verdict remains LGTM.
Assessment History
- review 4730527139 reviewed commit
6d716aed9b8626ea8447a09af4dabd2017b787c1with an LGTM verdict. Current verdict is also LGTM. Assessment unchanged: verdict, motivation, approach, and risk are all the same. The only intervening change is a rebase that preserved every PR patch and adjusted the browser-wasm timeout condition to also cover WASI, which does not affect the assessment.
Detailed Findings
None. The incremental change (WASI-inclusive browser-wasm timeout condition in helixpublishwitharcade.proj) is correct and consistent with the adjacent TargetsMobile logic.
Note
This review was generated by this repository's Holistic Review agentic workflow to complement the built-in Copilot review.
Generated by Holistic Review · 59.8 AIC · ⌖ 10.6 AIC · ⊞ 10K
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
@copilot please inspect the CI failures and mark the tests that failed due to multithreading as conditional on multithreading support. |
Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Fixed in 711de57. I inspected the browser-wasm CoreCLR CI failures and marked the tests that depend on managed |
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dfcc4829-304a-4277-ac35-91ba6510eb70
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/ba-g no unknown failures but BA still red |
Replaces eligible MSBuild
<JitOptimizationSensitive>and<GCStressIncompatible>properties with[SkipOnCoreClr(...)]applied directly to test entry points, moving skip logic from build-time property injection into the XUnit test runner where the test can safely run without process isolation.Description
Why
MSBuild properties like
<GCStressIncompatible>and<JitOptimizationSensitive>require<RequiresProcessIsolation>true</RequiresProcessIsolation>to take effect — process isolation is expensive. Moving eligible skips to XUnit attributes allows tests to be skipped in-process without spawning a new process per test. Tests that still require process isolation for other reasons retain<RequiresProcessIsolation>true</RequiresProcessIsolation>.Changes
JitOptimizationSensitive — ilproj tests (4
.ilfiles, 4.ilprojfiles)SkipOnCoreClrAttributewithAnyJitOptimizationStress(0x11E) to each IL entry point.assembly extern Microsoft.DotNet.XUnitExtensionswhere missing<JitOptimizationSensitive>and sole-cause<RequiresProcessIsolation>from project files<ProjectReference Include="$(TestLibraryProjectPath)" />to project files that were missing itGCStressIncompatible — all project types (~310 files total)
C# (150
.cs+ 150.csproj):[SkipOnCoreClr("This test is not compatible with GC stress.", RuntimeTestModes.AnyGCStress)]before each[Fact]/[Theory]/[ConditionalFact]/[ConditionalTheory]<GCStressIncompatible>and sole-cause<RequiresProcessIsolation>from project files<ProjectReference Include="$(TestLibraryProjectPath)" />to 65 csproj files that were missing it<GCStressIncompatible>from project files where the compiled source already had a corresponding[SkipOnCoreClr(..., RuntimeTestModes.AnyGCStress)]attributeIL (6
.ilproj, 3.il):SkipOnCoreClrAttribute(0xC0 =AnyGCStress) to IL entry points; updated project files<ProjectReference Include="$(TestLibraryProjectPath)" />to 6 ilproj files that were missing itF#:
Runtime_72845was left on the standalone[<EntryPoint>]/exit-code pattern with<GCStressIncompatible>true</GCStressIncompatible>and<RequiresProcessIsolation>true</RequiresProcessIsolation>retained, because the attempted XUnit conversion did not compile in targeted test buildsHeapVerifyIncompatible — migrated tests
<ProjectReference Include="$(TestLibraryProjectPath)" />to project files that were missing it<HeapVerifyIncompatible>was conditional on architecture, replaced the unconditional[SkipOnCoreClr(..., RuntimeTestModes.HeapVerify)]with[ConditionalFact]backed by a static bool property that combines the architecture check withTestLibrary.CoreClrConfigurationDetection.IsHeapVerify, preserving the original per-architecture skip semanticsComment cleanup
<GCStressIncompatible>was removed and updated or removed staleRequiresProcessIsolationcomments[SkipOnCoreClr(...)]attribute messagesRequiresProcessIsolationrationale comments positioned above the<RequiresProcessIsolation>property they describeInfrastructure and documentation
helixpublishwitharcade.proj(123 → 246 minutes) to accommodate the larger merged test collectionsrequiresprocessisolation.mdto document two additional triggers for<RequiresProcessIsolation>:<IsLongRunningGCTest>and<CLRTestExecutionArguments>CI failure fixes and process-isolation audit
<RequiresProcessIsolation>true</RequiresProcessIsolation>to tests that still require isolation for GC measurement accuracy, long-running GC pre-commands, custom CLR test execution arguments,GC.WaitForPendingFinalizers, unsupported target handling, unloadability, NativeAOT incompatibility, output-copying project references, orProcess.Start[ActiveIssue]suppressions for CI failures on browser-wasm CoreCLR and Mono interpreter browser-wasm where appropriateGetTotalAllocatedBytes.cswhile preserving GC stress and HeapVerify skip behaviorNot migrated (MSBuild property retained)
ReferenceXUnitWrapperGenerator=false— no XUnit runnerOutputType=Libraryprojects — no entry point[Fact]methodRuntime_72845.fsproj— F# XUnit conversion did not compile in targeted test builds, so this test retains<GCStressIncompatible>true</GCStressIncompatible>and standalone process isolationmultifolder,determinism/crossgen2determinism) —[SkipOnCoreClr]only skips the XUnit test body, not pre-commands that run before the test executablerequiresprocessisolation.mdrules retain<RequiresProcessIsolation>, including projects withCLRTestExecutionArguments,IsLongRunningGCTest,GC.WaitForPendingFinalizers,CLRTestTargetUnsupported,UnloadabilityIncompatible,NativeAotIncompatible,ProjectReference/content copying requirements, orProcess.Start