Skip to content

Add guidelines for RequiresProcessIsolation in tests#125034

Merged
MichalStrehovsky merged 3 commits intomainfrom
MichalStrehovsky-patch-1
Mar 2, 2026
Merged

Add guidelines for RequiresProcessIsolation in tests#125034
MichalStrehovsky merged 3 commits intomainfrom
MichalStrehovsky-patch-1

Conversation

@MichalStrehovsky
Copy link
Copy Markdown
Member

@MichalStrehovsky MichalStrehovsky commented Mar 2, 2026

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

Document when to set RequiresProcessIsolation in test projects, outlining specific rules and triggers based on project properties and source code patterns.
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 RequiresProcessIsolation triggers (MSBuild configuration and code patterns).
  • Adds summary tables for quick identification of project-file-based and source-code-based triggers.

Comment thread docs/workflow/testing/coreclr/requiresprocessisolation.md Outdated
Comment thread docs/workflow/testing/coreclr/requiresprocessisolation.md Outdated
Comment thread docs/workflow/testing/coreclr/requiresprocessisolation.md Outdated
Copy link
Copy Markdown
Member Author

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot make these changes

Comment thread docs/workflow/testing/coreclr/requiresprocessisolation.md
Comment thread docs/workflow/testing/coreclr/requiresprocessisolation.md Outdated
Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

@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
Copy link
Copy Markdown
Member Author

@copilot implement feedback from @copilot code review[agent]

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

@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>
Copilot AI review requested due to automatic review settings March 2, 2026 07:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread docs/workflow/testing/coreclr/requiresprocessisolation.md
@MichalStrehovsky MichalStrehovsky marked this pull request as ready for review March 2, 2026 09:11
@MichalStrehovsky MichalStrehovsky merged commit daa66d1 into main Mar 2, 2026
23 checks passed
@MichalStrehovsky MichalStrehovsky deleted the MichalStrehovsky-patch-1 branch March 2, 2026 22:18
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants