Skip to content

[release/10.0] Fix FileSystemWatcher multi-move test event ordering - #137688

Merged
lewing merged 1 commit into
dotnet:release/10.0from
lewing:lewing-backport-137557-to-release-10
Nov 17, 2026
Merged

lewing merged 1 commit into
dotnet:release/10.0from
lewing:lewing-backport-137557-to-release-10

Conversation

@lewing

@lewing lewing commented Nov 16, 2026

Copy link
Copy Markdown
Member

Fixes Issue
Test-only backport for the event-ordering failures tracked by #127651 and #137556.

main PR
#137557

Description

Adapt the test-only portions of b7bc828 to release/10.0.

The four multi-file/directory move assertions use a shared AssertEventsEqual helper. On macOS and MacCatalyst, it compares events as a multiset, preserving event identity, total counts, and duplicate counts. Windows and Linux retain strict ordering.

This branch has no PlatformDetection.IsOpenBSD, and the source PR's platform skips to remove are already absent. Those portions are omitted. Existing unrelated platform skips and event filtering are preserved, and no main-only deduplication infrastructure is imported.

All changes are confined to the four test/test-utility files. No product code or public API changes.

Customer Impact

No direct customer impact. This reduces intermittent FileSystemWatcher CI failures caused by macOS delivering events for different paths out of order.

Regression

No product regression. The tests incorrectly assumed cross-path event ordering on macOS.

Testing

On macOS arm64:

  • ./build.sh clr+libs -rc release on local main at a56ab6e before applying the backport: passed, with 18 existing dependency-vulnerability warnings and no errors. This was not a release/10.0 baseline build.
  • ./dotnet.sh build src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj -f net10.0-osx /p:UseLocalTargetingRuntimePack=false: passed, no warnings or errors.
  • ./dotnet.sh build src/tasks/installer.tasks/installer.tasks.csproj: passed, no warnings or errors; supplies the branch's test-runner generation task.
  • ./dotnet.sh build src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj /t:Test -f net10.0-osx /p:UseLocalTargetingRuntimePack=false "/p:NetCoreAppCurrentTestHostPath=$PWD/.dotnet/" "/p:XUnitOptions=-class System.IO.Tests.File_Move_Tests -class System.IO.Tests.Directory_Move_Tests": passed against the official .NET 10.0.15 runtime bundled with SDK 10.0.115, not the locally built main runtime. XML results confirm 27 passed, 0 failed, 0 skipped, including all 12 applicable multi-move cases.
  • A temporary, uncommitted reflection probe invoked the compiled assertion helper: all six checks passed (reordered duplicates accepted; unequal duplicate multiplicities, missing events, extra events, changed event types, and changed paths rejected).
  • git diff --check: passed.

The initial SDK extraction hit a disk-space error; after removing this session's disposable baseline build intermediates, SDK installation and the targeted build succeeded. The first test invocation lacked the branch's runner-generation task; building installer.tasks resolved it.

No full release/10.0 product build, full FileSystemWatcher suite, Windows/Linux/MacCatalyst execution, or PR CI run was performed. Event reordering is intermittent, so a passing local run alone does not establish that the flake is eliminated.

Risk

Low risk: test-only changes, with no shipped product or API changes. Only the four multi-move assertions change. On platforms that reorder events, comparison still rejects missing, extra, or different events, including differing duplicate counts. Strict ordering remains on Windows/Linux, and existing platform skips and filters are unchanged.

Package authoring no longer needed in .NET 9

IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

Note

This PR description was generated with GitHub Copilot.

Backport the applicable test-only changes from dotnet#137557. Preserve strict event ordering on Windows/Linux and compare multisets on macOS/MacCatalyst. Retain the release branch event filters and unrelated platform skips; omit unavailable OpenBSD support and already-absent skip removals.

(cherry picked from commit b7bc828)

Co-authored-by: Copilot App <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

@lewing lewing added the test-bug Problem in test source code (most likely) label Nov 16, 2026
@steveisok steveisok added the Servicing-approved Approved for servicing release label Nov 16, 2026
@lewing
lewing enabled auto-merge (squash) November 16, 2026 21:20
@lewing

lewing commented Nov 17, 2026

Copy link
Copy Markdown
Member Author

/ba-g release branch

@lewing
lewing disabled auto-merge November 17, 2026 01:40
@lewing
lewing merged commit e9f28fc into dotnet:release/10.0 Nov 17, 2026
107 of 111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.IO Servicing-approved Approved for servicing release test-bug Problem in test source code (most likely)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants