Skip to content

Isolate multithreaded build test from compiler-server mutex race - #56239

Closed
JeremyKuhne with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-flaky-test-multithreaded-argument
Closed

JeremyKuhne with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-flaky-test-multithreaded-argument

Conversation

Copilot AI commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

MultiThreadedArgument_BuildsProjectReferencesInProcess intermittently failed on Linux when Roslyn shared compilation hit a named-mutex ownership error during concurrent builds.

  • Isolation
    • Disable UseSharedCompilation for this test’s child build.
    • Preserve coverage of multithreaded MSBuild project-reference execution and the single-process assertion.
new DotnetCommand(Log, "build", "Program.cs", argument, "-p:UseSharedCompilation=false")

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
3 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 changed the title [WIP] Fix flaky test MultiThreadedArgument_BuildsProjectReferencesInProcess Isolate multithreaded build test from compiler-server mutex race Sep 10, 2026
Copilot AI requested a review from JeremyKuhne September 10, 2026 18:46
@JeremyKuhne
JeremyKuhne marked this pull request as ready for review September 11, 2026 13:59
Copilot AI lite review requested due to automatic review settings September 11, 2026 13:59
@JeremyKuhne
JeremyKuhne requested a review from a team as a code owner September 11, 2026 13:59
@JeremyKuhne
JeremyKuhne enabled auto-merge (squash) September 11, 2026 13:59
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
2 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.

🟢 Approval recommended

The change is narrowly scoped; the remaining documentation note is non-blocking.

Pull request overview

Isolates a multithreaded build test from Roslyn’s shared-compilation mutex race while preserving its coverage.

Changes:

  • Disables shared compilation for the child build.
  • Retains multithreaded project-reference and single-process assertions.
File summaries
File Description
test/dotnet.Tests/CommandTests/Run/RunFileTests_BuildOptions.cs Adds UseSharedCompilation=false to the targeted build test.
Review details

Suppressed comments (1)

test/dotnet.Tests/CommandTests/Run/RunFileTests_BuildOptions.cs:896

  • This is a test-isolation workaround for the compiler-server mutex race tracked by #56238. Please include the issue URL in the comment so future maintainers can tell when this opt-out can be revisited; otherwise the rationale is easy to lose when the test is updated.
        // Shared compilation uses a named mutex, which is unrelated to testing MSBuild's in-process nodes and can fail independently.
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

@JeremyKuhne

Copy link
Copy Markdown
Member

Closing as no longer needed: the shared-compilation mutex issue was addressed upstream in dotnet/roslyn#85675 (merged), and that fix is included in the compiler toolset currently referenced by SDK main. The test-specific UseSharedCompilation=false workaround can be reintroduced if the failure recurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Flaky test] MultiThreadedArgument_BuildsProjectReferencesInProcess fails with MSB3883

5 participants