Skip to content

Restore isolation for GC Collect tests - #132076

Merged
kkokosa merged 1 commit into
dotnet:mainfrom
kkokosa:fix-131721-gc-collect-isolation
Aug 12, 2026
Merged

Restore isolation for GC Collect tests#132076
kkokosa merged 1 commit into
dotnet:mainfrom
kkokosa:fix-131721-gc-collect-isolation

Conversation

@kkokosa

@kkokosa kkokosa commented Aug 10, 2026

Copy link
Copy Markdown
Member

Fixes #131721
Fixes #131893

PR #126108 removed process isolation from Collect, Collect0, and Collect1, allowing their generation assertions to observe GC state accumulated by earlier tests in the merged runner. Restore isolation because these tests require uncontested process-wide GC state.

Local x86 Checked investigation reproduced all three failures by accumulating leaked pinned handles in a shared process. The same failures occurred under FullOpt, while target-only runs, runs excluding AddrOfPinnedObject, and pin-and-free controls completed 10,000 iterations without failure, so this change preserves JIT-mode coverage instead of marking the tests JitOptimizationSensitive.

Validation:

  • Windows x64 and x86 Checked Core_Root and targeted GC test builds
  • Individual Collect, Collect0, and Collect1 wrappers
  • Full merged GC runner with the restored out-of-process dispatch

Note

This pull request description was prepared with GitHub Copilot.

These tests depend on process-wide GC state and cannot run reliably in the merged test runner.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f7186616-baa4-46ff-8c5e-2571610a7219
Copilot AI lite review requested due to automatic review settings August 10, 2026 13:19
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @anicka-net, @dotnet/gc
See info in area-owners.md if you want to be subscribed.

@kkokosa
kkokosa marked this pull request as ready for review August 10, 2026 13:21
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Restores per-test process isolation for the GC Collect, Collect0, and Collect1 test projects so their generation assertions run with uncontested, process-wide GC state (preventing cross-test GC-state leakage in merged runners).

Changes:

  • Re-added <RequiresProcessIsolation>true</RequiresProcessIsolation> to Collect, Collect0, and Collect1 test project files.
  • Documented the isolation requirement inline in each project file with a brief rationale comment.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/tests/GC/API/GC/Collect.csproj Restores process isolation for the Collect test project to avoid shared-process GC state interference.
src/tests/GC/API/GC/Collect0.csproj Restores process isolation for the Collect0 test project to ensure GC generation checks are reliable.
src/tests/GC/API/GC/Collect1.csproj Restores process isolation for the Collect1 test project to prevent contamination from prior tests in merged runners.

@kkokosa
kkokosa merged commit 705bed2 into dotnet:main Aug 12, 2026
87 checks passed
@kkokosa
kkokosa deleted the fix-131721-gc-collect-isolation branch August 12, 2026 06:38
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure: GC/API/GC/Collect0 fails on x86 jitminopts Test failure: GC/API/GC/Collect/Collect.dll

3 participants