Skip to content

[Flaky test] MTPHelpSnapshotTests races with DOTNET_NOLOGO mutation under parallel execution #56264

Closed

Description

@JeremyKuhne

Description

MTPHelpSnapshotTests.VerifyMTPHelpOutput intermittently captures dotnet test --help while another dotnet.Tests class has set the process-wide DOTNET_NOLOGO environment variable. The snapshot then reports the --no-logo default as True instead of False.

The failing run includes #56036, which changed dotnet.Tests from serial execution to class-level parallelization.

Failure

- [default: False]
+ [default: True]

Analysis

The Helix shard ran with four class-level workers and included both MTPHelpSnapshotTests and TestCommandDefinitionTests.

MTPCommandHonorsDotnetNoLogoEnvironmentVariable temporarily sets DOTNET_NOLOGO to true and false. It holds ResourceLock(WellKnownResources.EnvironmentVariables), but VerifyMTPHelpOutput does not. Resource locks only coordinate tests declaring the same resource, so the snapshot can launch its child process while DOTNET_NOLOGO=true.

CommonOptions.CreateNoLogoOption(defaultValue: false) reads DOTNET_NOLOGO, producing the exact observed difference.

Expected behavior

Tests that read process-global environment state during product launch should coordinate with tests that mutate it. Applying the environment-variable resource lock to the snapshot test would close this race.

Evidence

Error Message

{
  "ErrorMessage": "Microsoft.DotNet.Cli.Test.Tests.MTPHelpSnapshotTests.VerifyMTPHelpOutput",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1591575
Error message validated: [Microsoft.DotNet.Cli.Test.Tests.MTPHelpSnapshotTests.VerifyMTPHelpOutput]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 9/11/2026 2:21:34 PM UTC

Report

Build Repository Test Pull Request
1595278 dotnet/sdk dotnet.Tests.dll.22.WorkItemExecution #55939
1591575 dotnet/sdk Microsoft.DotNet.Cli.Test.Tests.MTPHelpSnapshotTests.VerifyMTPHelpOutput #56185

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
1 2 2

Activity

  1. added theissue type on Sep 11, 2026
  2. added
    untriaged
    on Sep 11, 2026
  3. locked and limited conversation to collaborators on Sep 11, 2026
  4. unlocked this conversation on Sep 11, 2026
  5. added and removed
    untriaged
    on Sep 11, 2026
  6. github-actions commented on Sep 11, 2026

    @github-actions
    Contributor

    🎯 Agentic Issue Triage

    Triage Assessment:

    • 🏷️ Labels: Applied, modified, and already-present relevant labels: Bug Area-CLI Test Debt Known Build Error
    • 💻 Assignment: @vlada-shubina | @dotnet/dotnet-cli
    • 🟩 Confidence: high - Clear analysis identifies the exact race condition, affected tests, and file paths under Area-CLI's CODEOWNERS scope.

    ➡️ Summary: MTPHelpSnapshotTests intermittently fails because it reads DOTNET_NOLOGO without coordinating with tests that mutate that env var under parallel execution. Apply the environment-variable resource lock to the snapshot test to close the race.

    Generated by 🏷️ Issue Triage for #56264 · copilot · auto · 54.2 AIC · ⌖ 11.5 AIC · ⊞ 14.6K · ◷

  7. Youssef1313 commented on Sep 14, 2026

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

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions