dotnet / dotnet/msbuild

[Flaky Test] Microsoft.Build.UnitTests.TaskEnvironment_Tests.TaskEnvironment_SetEnvironment_ShouldReplaceAllVariables

Open Beginner friendly
#14,626 4 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
flaky-test-id: [Test Method Cleanup Failure (Microsoft.Build.UnitTests.TaskEnvironment_Tests.TaskEnvironment_SetEnvironment_ShouldReplaceAllVariables(environmentType: "Stub"))]
```

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

## Evidence

The test method cleanup is failing intermittently on the **CoreOnLinux** leg (net10.0 and net11.0), across 4 distinct rolling `main` builds — no PR-specific evidence.

- **Assembly:** `Microsoft.Build.Engine.UnitTests`
- **Class:** `Microsoft.Build.UnitTests.TaskEnvironment_Tests`
- **Method:** `TaskEnvironment_SetEnvironment_ShouldReplaceAllVariables` (both `environmentType: "Stub"` and `environmentType: "Multithreaded"` parameterizations)
- **Distinct rolling builds:** 4 ([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), [1536982](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1536982))
- **Legs:** CoreOnLinux
- **TFMs:** net10.0, net11.0
- **First seen:** 2026-07-20
- **Last seen:** 2026-08-03
- **Sample error:** (cleanup failure — no error message captured)

## Source location

`src/Build.UnitTests/BackEnd/TaskEnvironment_Tests.cs`

## Notes

This test will be quarantined via `[ActiveIssue("")]` (from `Microsoft.DotNet.XUnitV3Extensions`, namespace `Xunit`) once this issue is confirmed open. The quarantine pipeline (def 344) will gather further signal. A real fix is tracked separately.

> [!WARNING]
>
> Firewall blocked 1 domain
>
> The following domain was blocked by the firewall during workflow execution:
>
> - `southcentralus0.in.applicationinsights.azure.com`
>
> To allow these domains, add them to the `network.allowed` list in your workflow frontmatter:
>
> ```yaml
> network:
> allowed:
> - defaults
> - "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/30814926510) · sonnet46 · 122.4 AIC · ⌖ 6.59 AIC · ⊞ 15K · [◷](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 in src/Build.UnitTests/BackEnd/TaskEnvironment_Tests.cs and inspect TaskEnvironment_SetEnvironment_ShouldReplaceAllVariables for the Stub and Multithreaded parameterizations. Confirm the issue is open, then apply the stated ActiveIssue quarantine and verify that the quarantine pipeline can track further failures; the underlying fix is tracked separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, testing
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.