dotnet / dotnet/msbuild

[Flaky Test] Microsoft.Build.UnitTests.CodeTaskFactoryTests.BuildTaskSimpleCodeFactory

Open
#14,571 6 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: Microsoft.Build.UnitTests.CodeTaskFactoryTests.BuildTaskSimpleCodeFactory
```

## Evidence

Multiple CodeTaskFactory tests are failing together on Windows net472 CI runs, suggesting a shared infrastructure issue (compiler/sandbox availability).

- **Distinct sources:** 3 (0 PRs + 3 rolling builds)
- **Rolling builds:** [1514373](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1514373), [1517682](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1517682), [1527742](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1527742)
- **Legs:** FullOnWindows Release
- **TFMs:** net472
- **Assembly:** Microsoft.Build.Tasks.UnitTests
- **First seen:** 2026-07-17 | **Last seen:** 2026-07-27

**Also affected (same error hash, same builds):** `BuildTaskSimpleCodeFactory_RedirectFrom4`, `BuildTaskSimpleCodeFactory_RedirectFrom12`, `BuildTaskSimpleCodeFactory_NoAssemblyNameRedirect`, `BuildTaskSimpleCodeFactoryTestExtraUsing`, `BuildTaskDateCodeFactory`, `EmbedsGeneratedFromSourceFileInBinlog`

## Sample error

```
Assert.True() Failure
Expected: True
Actual: False
```

## Fully-qualified test name

`Microsoft.Build.UnitTests.CodeTaskFactoryTests.BuildTaskSimpleCodeFactory`

Source: `src/Tasks.UnitTests/CodeTaskFactoryTests.cs`

## Next steps

This test (and related CodeTaskFactory tests) will be quarantined via `[ActiveIssue("https://github.com/dotnet/msbuild/issues/")]` (from `Microsoft.DotNet.XUnitV3Extensions`, namespace `Xunit`) until the underlying nondeterminism is fixed.

> [!WARNING]
>
> Firewall blocked 1 domain
>
> The following domain was blocked by the firewall during workflow execution:
>
> - `awmgmcpg`
>> To allow these domains, add them to the `network.allowed` list in your workflow frontmatter:
>
> ```yaml
> network:
> allowed:
> - defaults
> - "awmgmcpg"
> ```
>
> 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/30451703648) · sonnet46 · 150.7 AIC · ⌖ 5.46 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 src/Tasks.UnitTests/CodeTaskFactoryTests.cs and reproduce Microsoft.Build.UnitTests.CodeTaskFactoryTests.BuildTaskSimpleCodeFactory on the FullOnWindows Release net472 leg. Compare the related CodeTaskFactory failures and investigate the shared compiler or sandbox availability indicated by the CI evidence. Done means the nondeterministic failures are fixed and the tests pass without quarantine.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.