Skip to content

Build just once when tfms run in parallel#15465

Merged
nohwnd merged 2 commits intomicrosoft:mainfrom
nohwnd:build-only-once-even-in-dotnet-test-parallel
Mar 10, 2026
Merged

Build just once when tfms run in parallel#15465
nohwnd merged 2 commits intomicrosoft:mainfrom
nohwnd:build-only-once-even-in-dotnet-test-parallel

Conversation

@nohwnd
Copy link
Member

@nohwnd nohwnd commented Mar 9, 2026

Description

Running dotnet test would trigger build of assets from two places at the same time, which does more work, and also fails occasionally when they run into each other.

Related issue

Fix #15453

Copilot AI review requested due to automatic review settings March 9, 2026 16:24
Copy link
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

This PR prevents parallel dotnet test runs (across TFMs) from rebuilding/patching the same test assets concurrently by introducing a named mutex guarding the one-time build/setup work.

Changes:

  • Added a named Mutex to serialize build/setup across parallel test runs within the same repo clone.
  • Moved build/setup steps (unzip, cache cleanup, asset builds, dotnet patching) behind the mutex.
  • Added a timeout path for waiting test runs.

@nohwnd nohwnd enabled auto-merge (squash) March 10, 2026 07:41
@nohwnd nohwnd merged commit 9d41bec into microsoft:main Mar 10, 2026
6 checks passed
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.

Running dotnet test on integration tests will run Build (the method) on both

4 participants