Add guidelines for RequiresProcessIsolation in tests#125034
Add guidelines for RequiresProcessIsolation in tests#125034MichalStrehovsky merged 3 commits intomainfrom
Conversation
Document when to set RequiresProcessIsolation in test projects, outlining specific rules and triggers based on project properties and source code patterns.
|
Tagging subscribers to this area: @dotnet/area-system-diagnostics-process |
There was a problem hiding this comment.
Pull request overview
Adds a new CoreCLR testing workflow document that explains when a test project must opt out of merged test runners by setting <RequiresProcessIsolation>true</RequiresProcessIsolation>, based on project-file configuration and source-code patterns that affect process-wide state.
Changes:
- Introduces a rule-based checklist of
RequiresProcessIsolationtriggers (MSBuild configuration and code patterns). - Adds summary tables for quick identification of project-file-based and source-code-based triggers.
MichalStrehovsky
left a comment
There was a problem hiding this comment.
@copilot make these changes
|
@MichalStrehovsky I've opened a new pull request, #125035, to work on those changes. Once the pull request is ready, I'll request review from you. |
…5035) Addresses reviewer feedback on #125034 regarding the `RequiresProcessIsolation` documentation. ## Changes - **`requiresprocessisolation.md`**: Folds the standalone `AutoreleasePoolSupport` rule into the `RuntimeHostConfigurationOption` rule, since `AutoreleasePoolSupport` is just an MSBuild shorthand that expands into a `RuntimeHostConfigurationOption` item. References [`Microsoft.NET.ILLink.targets`](../../../../src/tools/illink/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets) as the source of truth for other such shorthand properties. Renumbers all subsequent rules and fixes a pre-existing duplicate rule-17 numbering error. - **`testing.md`**: Adds a forward link from the existing "When to make a test RequiresProcessIsolation" section to `requiresprocessisolation.md`. <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
|
@MichalStrehovsky I've opened a new pull request, #125036, to work on those changes. Once the pull request is ready, I'll request review from you. |
## Description Documents when CoreCLR test projects must set `<RequiresProcessIsolation>true</RequiresProcessIsolation>` to opt out of merged test runners. Adds `docs/workflow/testing/coreclr/requiresprocessisolation.md` with: - **28 numbered rules** covering both project-file triggers (env vars, runtime host config, trimming, native deps, incompatibility flags) and source-code triggers (`Environment.Exit`, process-wide GC ops, collectible ALCs, custom `Main`, crash-by-design, etc.) - **`RuntimeHostConfigurationOption` shorthands** collapsed into a single rule, referencing [`Microsoft.NET.ILLink.targets`](src/tools/illink/src/ILLink.Tasks/build/Microsoft.NET.ILLink.targets) as source of truth for feature-switch properties like `AutoreleasePoolSupport` - **Two summary tables** for quick scanning: project-file-based triggers (MSBuild properties/items) and source-code-based triggers Already linked from the existing [testing.md](docs/workflow/testing/coreclr/testing.md) at line 181. <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/dotnet/runtime/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Document when to set RequiresProcessIsolation in test projects, outlining specific rules and triggers based on project properties and source code patterns.
Cc @elinor-fung @jkoritzinsky