Skip to content

Fix template path in quarantine pipeline - #14937

Merged
AR-May merged 2 commits into
dotnet:mainfrom
AR-May:ar-may-fix-quarantine-template-path
Sep 7, 2026
Merged

AR-May merged 2 commits into
dotnet:mainfrom
AR-May:ar-may-fix-quarantine-template-path

Conversation

@AR-May

@AR-May AR-May commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

The quarantine pipeline has not run since #14371 (~50 days!). It fails
while parsing YAML.

Cause: template: paths resolve relative to the file that contains them.
quarantine.yml is already in azure-pipelines/, so the extra prefix pointed to
a folder that does not exist.

Template paths resolve relative to the referencing file. quarantine.yml
is already inside azure-pipelines/, so the azure-pipelines/ prefix
resolved to azure-pipelines/azure-pipelines/ and the pipeline failed at
YAML compile time on every run since dotnet#14371.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AR-May
AR-May marked this pull request as ready for review September 4, 2026 12:27
@AR-May
AR-May requested review from VolPlita and a lite review from Copilot September 4, 2026 12:27
@AR-May
AR-May enabled auto-merge (squash) September 4, 2026 12:29

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.

🟢 Approval recommended

The change is a straightforward correction of YAML template paths and appears consistent across all affected jobs with no functional risk beyond restoring the pipeline parsing.

Pull request overview

Fixes YAML template includes in the Azure DevOps quarantine pipeline by updating template: paths to be relative to azure-pipelines/quarantine.yml, restoring the pipeline’s ability to parse and run.

Changes:

  • Update the check-documentation-only-change.yml template reference in each quarantine job (Windows/Linux/macOS) to use a relative path.
File summaries
File Description
azure-pipelines/quarantine.yml Fix template include paths so YAML parsing succeeds and the quarantine pipeline can run again.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@VolPlita

VolPlita commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

pipelines still fail, check-documentation-only-change.yml runs git diff ... HEAD~1, while the jobs use a shallow checkout without HEAD~1, so build never executes and artifacts are missing.

Comment thread azure-pipelines/quarantine.yml Resolved
The quarantine definition fetches with depth 1, but
check-documentation-only-change.yml runs `git diff HEAD HEAD~1`, which fails
with "unknown revision" because the parent commit was never fetched. The step
then fails the job before the build runs. msbuild-pr is unaffected because its
definition sets fetchDepth 0.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0518e79a-a652-4869-aa2e-5dc82c738c0b
@AR-May
AR-May requested a review from VolPlita September 4, 2026 13:37
@AR-May

AR-May commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@AR-May
AR-May merged commit 594deea into dotnet:main Sep 7, 2026
14 checks passed
ViktorHofer pushed a commit that referenced this pull request Sep 10, 2026
Related issue(s): Windows Core CI failure in
`AutoUsesChangeWaveFallback`, observed while validating #14937.
<!-- Use "Fixes #..." only when this PR completes the linked issue. -->

### Context

<!-- What user-visible problem does this solve? -->

`RecordingFileSystem` records enumeration calls in an unsynchronized
`List<T>`, but the legacy file matcher can invoke the same filesystem
wrapper from parallel directory traversal. This makes the test fixture
itself unsafe: an otherwise valid glob can fail intermittently or leave
an incomplete record of enumeration calls.

The reported Windows Core job failed in the net472/x86 Framework tests
with an `AggregateException` containing `IndexOutOfRangeException`
failures from `List<T>.Add` in `RecordingFileSystem.EnumerateFiles` and
`EnumerateDirectories`. The same test passed on retry without a code
change; retrying does not remove the underlying race.

#### Step-by-step failure mode

1. `AutoUsesChangeWaveFallback` sets `MSBUILDDISABLEFEATURESFROMVERSION`
to `Wave18_11`, resets change-wave state, and verifies that a matcher
backed by `DirectRecordingFileSystem` selects the legacy implementation.
2. The test invokes `GetFiles` with a recursive `**/*.cs` glob over a
directory tree.
3. When the available parallelism is at least two,
`FileMatcher.GetFilesRecursive` uses `Parallel.ForEach` to traverse
subdirectories.
4. Multiple workers call enumeration methods on the same
`DirectRecordingFileSystem`. Those methods are inherited from
`RecordingFileSystem` and append to the same `EnumerationCalls` list
without synchronization.
5. Concurrent `List<T>.Add` operations race on shared size, capacity,
and backing-array state. This can lose recorded entries or produce an
invalid array access.
6. Exceptions thrown by traversal workers are surfaced through
`Parallel.ForEach` as an `AggregateException`, failing the test.

The historical exception stacks identify this path. The new regression
independently reproduced lost writes before the fix: **12,283 calls
recorded instead of 12,288** on net472/x86. Concurrent corruption is
therefore reproduced; the exact instruction-level interleaving behind
the historical `IndexOutOfRangeException` is inferred, not reproduced.

### Changes Made

<!-- Summarize the approach and meaningful changes. -->

- Replace the private fixture's `List<(string Operation, string Path,
string Pattern)>` with `ConcurrentQueue` and change all three recording
sites to `Enqueue`: `EnumerateFiles`, `EnumerateDirectories`, and
`EnumerateFileSystemEntries`.
- Add `RecordingFileSystemPreservesConcurrentEnumerationCalls`, which
invokes all three methods through `DirectRecordingFileSystem` in a
bounded `Parallel.For`, then checks the total count and exact recorded
tuples without assuming cross-thread ordering.

A concurrent queue makes every recording write thread-safe while
preserving sequential FIFO behavior and the existing enumeration-based
assertions. It avoids adding locks around filesystem operations or
changing production traversal. The fix is confined to
`src/Framework.UnitTests/Globbing/FileMatcherOptimized_Tests.cs`.

### Compatibility

<!-- Delete if not applicable. Note affected modes/platforms and changes
to defaults,
diagnostics, APIs or protocols, including compatibility between older
and newer hosts. -->

Test-only change. No production behavior, defaults, diagnostics, APIs,
protocols, or change-wave behavior changes. No changes targeting the
separate macOS or Windows Full incidents.

### Testing

<!-- Give relevant evidence, including commands/results and any coverage
gaps.
For MT/lifecycle changes, consider repeated builds, cancellation and
mixed-version hosts
where relevant; a full matrix is not required for every change. -->

- **Before fix:** the new regression failed on net472/x86 with 12,283
actual entries versus 12,288 expected.
- **Full repository build:** `.\build.cmd -v quiet -msbuildEngine
dotnet` passed with zero warnings/errors.
- **Affected test class:** `.\.dotnet\dotnet.exe test
"$PWD\src\Framework.UnitTests\Microsoft.Build.Framework.UnitTests.csproj"
--no-build -- --filter-class
"Microsoft.Build.UnitTests.Globbing.FileMatcherOptimized_Tests"` passed
on net472/x86 and net11.0/x64: **220 passed, 39 skipped, zero
failures**.
- **Framework Release tests:** `.\.dotnet\dotnet.exe test
"$PWD\src\Framework.UnitTests\Microsoft.Build.Framework.UnitTests.csproj"
-c Release -- --no-progress` passed: **2,237 passed, 73 skipped, zero
failures** across both target frameworks.
- **Bootstrap checks:** environment activation, SDK version, MSBuild
help, and bootstrap `dotnet build
src\Samples\Dependency\Dependency.csproj -v:q` passed.

Validation used the repository-pinned .NET SDK because the installed
Visual Studio MSBuild was older than the SDK's minimum supported
version. Bootstrap copy locks from local build/compiler servers were
cleared before the successful Release run; no repository configuration
changes were needed. The concurrency regression is scheduling-dependent
and does not force the historical exception interleaving.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AR-May AR-May self-assigned this Sep 11, 2026
This was referenced Nov 16, 2026
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.

3 participants