dotnet / dotnet/msbuild

[Flaky Test] Microsoft.Build.UnitTests.TaskEnvironment_Tests.TaskEnvironment_SetEnvironment_ShouldReplaceAllVariables (Stub) - Test Method Cl [Content truncated due to length]

Open
#14,604 0 comments 0 reactions 0 assignees View on GitHub
flaky-test
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

**Flaky-test key** (automated de-duplication — do not edit):
```text
[Test Method Cleanup Failure (Microsoft.Build.UnitTests.TaskEnvironment_Tests.TaskEnvironment_SetEnvironment_ShouldReplaceAllVariables(environmentType: "Stub"))]
```

## Summary

The test method cleanup for `Microsoft.Build.UnitTests.TaskEnvironment_Tests.TaskEnvironment_SetEnvironment_ShouldReplaceAllVariables` (environmentType: `Stub`) is intermittently failing in CI as a **test cleanup failure** on Linux.

## Evidence

- **Distinct sources:** 3 independent rolling builds on `main`
- **Affected leg:** CoreOnLinux
- **TFMs:** net10.0, net11.0
- **Assembly:** Microsoft.Build.Engine.UnitTests
- **First seen:** 2026-07-20 | **Last seen:** 2026-07-30
- **Rolling build IDs:** [1517682](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1517682), [1527742](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1527742), [1532844](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1532844)

## Notes

This is a **test cleanup failure** (not the test body itself). The cleanup is leaving the environment in a bad state on Linux. The test will be investigated and quarantined once this issue is open (next automated run).

> [!WARNING]
>
> Firewall blocked 2 domains
>
> The following domains were blocked by the firewall during workflow execution:
>
> - `awmgmcpg`
> - `southcentralus0.in.applicationinsights.azure.com`
>> To allow these domains, add them to the `network.allowed` list in your workflow frontmatter:
>
> ```yaml
> network:
> allowed:
> - defaults
> - "awmgmcpg"
> - "southcentralus0.in.applicationinsights.azure.com"
> ```
>
> See [Network Configuration](https://github.github.com/gh-aw/reference/network/) for more information.
>
>

> Generated by [Flaky Test Triage](https://github.com/dotnet/msbuild/actions/runs/30699098303) · sonnet46 · 128.5 AIC · ⌖ 4.9 AIC · ⊞ 14.7K · [◷](https://github.com/search?q=repo%3Adotnet%2Fmsbuild+is%3Aissue+%22gh-aw-workflow-call-id%3A+dotnet%2Fmsbuild%2Fflaky-test-detector.agent%22&type=issues)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with Microsoft.Build.UnitTests.TaskEnvironment_Tests.TaskEnvironment_SetEnvironment_ShouldReplaceAllVariables for environmentType "Stub" and inspect its cleanup behavior on the CoreOnLinux leg. Reproduce the intermittent cleanup failure in the Microsoft.Build.Engine.UnitTests assembly; done means the environment is restored reliably and the test passes repeatedly on Linux.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.