Skip to content

Fix MTP help snapshot environment race - #56286

Merged
Evangelink merged 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/fix-mtp-help-nologo-race
Sep 14, 2026
Merged

Evangelink merged 1 commit into
dotnet:mainfrom
Evangelink:dev/amauryleve/fix-mtp-help-nologo-race

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

  • coordinate MTPHelpSnapshotTests.VerifyMTPHelpOutput with tests that mutate process environment variables
  • prevent DOTNET_NOLOGO from changing the --no-logo default captured by the help snapshot during class-level parallel execution
  • preserve parallel execution for unrelated test classes

Fixes #56264

Testing

  • built the Debug SDK with build.cmd
  • ran MTPHelpSnapshotTests together with MTPCommandHonorsDotnetNoLogoEnvironmentVariable once, then repeated the paired run three more times
  • all 8 test executions passed; TRX timing showed the resource lock serialized the conflicting tests

Copilot AI lite review requested due to automatic review settings September 14, 2026 09:01
@Evangelink
Evangelink requested a review from a team as a code owner September 14, 2026 09:01
@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.

Copilot review overview

🟢 Approval recommended

The reviewed change addresses the race with no unresolved issues.

Review tier: Lite
Findings: None

What changed in this PR

Fixes an environment-variable race in the MTP help snapshot test involving DOTNET_NOLOGO.

Changes:

  • Adds environment-variable resource locking to VerifyMTPHelpOutput.
  • Preserves parallelism for unrelated test classes.
File Description
test/​dotnet.Tests/​CommandTests/​Test/​MTPHelpSnapshotTests.cs Serializes the snapshot test with environment-mutating tests.

@Evangelink
Evangelink enabled auto-merge (squash) September 14, 2026 09:13
@Evangelink
Evangelink merged commit 3bb97a8 into dotnet:main Sep 14, 2026
24 checks passed
}

[TestMethod]
[ResourceLock(WellKnownResources.EnvironmentVariables)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should whatever other test that was competing also have the same ResourceLock?

This branch had an error being deployed

1 failed deployment
copilot-pat-pool — 1c9b57ea Deployed Sep 14, 2026 by Evangelink via pre_activation #4726
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] MTPHelpSnapshotTests races with DOTNET_NOLOGO mutation under parallel execution

4 participants