Migrate JitOptimizationSensitive and GCStressIncompatible to SkipOnCoreClr attributes#126108
Migrate JitOptimizationSensitive and GCStressIncompatible to SkipOnCoreClr attributes#126108
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 |
|
/azp run runtime-coreclr outerloop |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@copilot resolve the merge conflicts in this pull request |
…lict Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
Done in 1d065ad. Merged origin/main; the only conflict was in |
|
/azp run runtime-coreclr outerloop, runtime-nativeaot-outerloop |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
@copilot the test src/tests/GC/API/GCHandle/Weak.csproj calls GC.WaitForPendingFinalizers() and is therefore not eligible to drop RequiresProcessIsolation (it also leaks a GCHandle, making it a poor fit for the unisolated runner). Audit all the tests that remove RequiresProcessIsolation=true in this branch against the rules in file docs/workflow/testing/coreclr/requiresprocessisolation.md and make sure we're not dropping RequiresProcessIsolation where we should be keeping it. |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/5e94967a-7c80-4e84-9351-ffcf764ab73c Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Done in c307c3f. I audited all projects where this branch removed |
|
@copilot changes in this branch leave things in non-sensical state. For example: src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.csproj Deleted the Audit all the changes in this branch for this pattern and fix it by moving the important detail from the orphaned comment to the new attribute. |
Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/ab28aaa2-5050-4fbd-aed4-0be8580e93f6 Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Addressed in f4ac6ac. I audited the migrated |
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 messagesInfrastructure 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